Trait stremio_core::runtime::Env

source ·
pub trait Env {
    // Required methods
    fn fetch<IN: Serialize + ConditionalSend + 'static, OUT: for<'de> Deserialize<'de> + ConditionalSend + 'static>(
        request: Request<IN>,
    ) -> TryEnvFuture<OUT>;
    fn get_storage<T: for<'de> Deserialize<'de> + ConditionalSend + 'static>(
        key: &str,
    ) -> TryEnvFuture<Option<T>>;
    fn set_storage<T: Serialize>(
        key: &str,
        value: Option<&T>,
    ) -> TryEnvFuture<()>;
    fn exec_concurrent<F: Future<Output = ()> + ConditionalSend + 'static>(
        future: F,
    );
    fn exec_sequential<F: Future<Output = ()> + ConditionalSend + 'static>(
        future: F,
    );
    fn now() -> DateTime<Utc>;
    fn flush_analytics() -> EnvFuture<'static, ()>;
    fn analytics_context(
        ctx: &Ctx,
        streaming_server: &StreamingServer,
        path: &str,
    ) -> Value;
    fn log(message: String);

    // Provided methods
    fn addon_transport(transport_url: &Url) -> Box<dyn AddonTransport>
       where Self: Sized + 'static { ... }
    fn migrate_storage_schema() -> TryEnvFuture<()>
       where Self: Sized { ... }
}

Required Methods§

source

fn fetch<IN: Serialize + ConditionalSend + 'static, OUT: for<'de> Deserialize<'de> + ConditionalSend + 'static>( request: Request<IN>, ) -> TryEnvFuture<OUT>

source

fn get_storage<T: for<'de> Deserialize<'de> + ConditionalSend + 'static>( key: &str, ) -> TryEnvFuture<Option<T>>

source

fn set_storage<T: Serialize>(key: &str, value: Option<&T>) -> TryEnvFuture<()>

source

fn exec_concurrent<F: Future<Output = ()> + ConditionalSend + 'static>( future: F, )

source

fn exec_sequential<F: Future<Output = ()> + ConditionalSend + 'static>( future: F, )

source

fn now() -> DateTime<Utc>

source

fn flush_analytics() -> EnvFuture<'static, ()>

source

fn analytics_context( ctx: &Ctx, streaming_server: &StreamingServer, path: &str, ) -> Value

source

fn log(message: String)

Provided Methods§

source

fn addon_transport(transport_url: &Url) -> Box<dyn AddonTransport>
where Self: Sized + 'static,

source

fn migrate_storage_schema() -> TryEnvFuture<()>
where Self: Sized,

Object Safety§

This trait is not object safe.

Implementors§