pub trait State:
Send
+ Sync
+ 'static {
// Required methods
fn get<'life0, 'async_trait>(
&'life0 self,
request: Request<StateGetRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StateGetResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn put<'life0, 'async_trait>(
&'life0 self,
request: Request<StatePutRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StatePutResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Generated trait containing gRPC methods that should be implemented for use with StateServer.
Required Methods§
Sourcefn get<'life0, 'async_trait>(
&'life0 self,
request: Request<StateGetRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StateGetResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
request: Request<StateGetRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StateGetResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the calling entry’s opaque state and current revision, including during initialize.
Sourcefn put<'life0, 'async_trait>(
&'life0 self,
request: Request<StatePutRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StatePutResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
request: Request<StatePutRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StatePutResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compare and durably replace state before returning; conflicts require Get before retry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".