Skip to main content

Host

Trait Host 

Source
pub trait Host:
    Sized
    + Send
    + Sync {
    type Error: Error + Send + Sync + 'static;
    type Instance<O: OperationDeclaration>: Instance<O, Error = Self::Error>;

    // Required methods
    fn context(&self) -> &CallContext;
    fn with_value<T>(&self, value: T) -> Result<Self, ContextError>
       where T: ContextValue;
    fn submit<O>(
        &self,
        request: O,
    ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
       where O: OperationDeclaration;
    fn call<O>(
        &self,
        request: O,
    ) -> impl Future<Output = Result<Response<<O as OperationDeclaration>::Response>, Self::Error>> + Send
       where O: OperationDeclaration;
    fn submit_with_resources<O, R>(
        &self,
        request: O,
        resources: Arc<R>,
    ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
       where O: OperationDeclaration<Response = ()>,
             R: Send + Sync + 'static;

    // Provided methods
    fn publish_on<S>(
        &self,
        row: &<S as StreamSpec>::Row,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send
       where S: StreamSpec,
             <S as StreamSpec>::Row: Message { ... }
    fn publish<S>(
        &self,
        row: &S,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send
       where S: StreamSpec<Row = S> + Message { ... }
}

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Source

type Instance<O: OperationDeclaration>: Instance<O, Error = Self::Error>

Required Methods§

Source

fn context(&self) -> &CallContext

Source

fn with_value<T>(&self, value: T) -> Result<Self, ContextError>
where T: ContextValue,

Source

fn submit<O>( &self, request: O, ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send

Source

fn call<O>( &self, request: O, ) -> impl Future<Output = Result<Response<<O as OperationDeclaration>::Response>, Self::Error>> + Send

Source

fn submit_with_resources<O, R>( &self, request: O, resources: Arc<R>, ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
where O: OperationDeclaration<Response = ()>, R: Send + Sync + 'static,

Provided Methods§

Source

fn publish_on<S>( &self, row: &<S as StreamSpec>::Row, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where S: StreamSpec, <S as StreamSpec>::Row: Message,

Source

fn publish<S>( &self, row: &S, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where S: StreamSpec<Row = S> + Message,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§