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 as OperationDeclaration>::Request,
    ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
       where O: OperationDeclaration;
    fn submit_owned<O>(
        &self,
        request: <O as OperationDeclaration>::Request,
        claims: RequestClaims,
    ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
       where O: OperationDeclaration;
    fn call<O>(
        &self,
        request: <O as OperationDeclaration>::Request,
    ) -> impl Future<Output = Result<Response<<O as OperationDeclaration>::Response>, Self::Error>> + Send
       where O: OperationDeclaration;
    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;

    // Provided methods
    fn call_owned<O>(
        &self,
        request: <O as OperationDeclaration>::Request,
        claims: RequestClaims,
    ) -> impl Future<Output = Result<Response<<O as OperationDeclaration>::Response>, Self::Error>> + Send
       where O: OperationDeclaration { ... }
    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 as OperationDeclaration>::Request, ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send

Source

fn submit_owned<O>( &self, request: <O as OperationDeclaration>::Request, claims: RequestClaims, ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send

Source

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

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,

Provided Methods§

Source

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

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§