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§
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>> + Sendwhere
O: OperationDeclaration,
fn call<O>(
&self,
request: O,
) -> impl Future<Output = Result<Response<<O as OperationDeclaration>::Response>, Self::Error>> + Sendwhere
O: OperationDeclaration,
fn submit_with_resources<O, R>( &self, request: O, resources: Arc<R>, ) -> impl Future<Output = Result<Self::Instance<O>, Self::Error>> + Send
Provided Methods§
fn publish_on<S>( &self, row: &<S as StreamSpec>::Row, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn publish<S>(
&self,
row: &S,
) -> impl Future<Output = Result<(), Self::Error>> + Sendwhere
S: StreamSpec<Row = S> + Message,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".