pub(crate) async fn save_state<T>(self, key: Cow<'static, [u8]>, value: T) -> bool
    where
        REv: From<StateStoreRequest>,
        T: Serialize,
    {
        match bincode::serialize(&value) {
            Ok(data) => {
                self.make_request(
                    move |responder| StateStoreRequest::Save {
                        key,
                        data,
                        responder,
                    },
                    QueueKind::Regular,
                )
                .await;
                true
            }
            Err(err) => {
                let type_name = type_name::<T>();
                warn!(%type_name, %err, "error serializing state");
                false
            }
        }
    }
/// Save state to storage.
///
/// Key must be a unique key across the the application, as all keys share a common namespace.
///
/// Returns whether or not storing the state was successful. A component that requires state to
/// be successfully stored should check the return value and act accordingly.
Save state to storage.
Key must be a unique key across the the application, as all keys share a common namespace.

Returns whether or not storing the state was successful. A component that requires state to
be successfully stored should check the return value and act accordingly.
Save state to storage . Key must be a unique key across the the application as all keys share a common namespace . Returns whether or not storing the state was successful . A component that requires state to be successfully stored should check the return value and act accordingly .
pub(crate) async fn save_state<T>(self, key: Cow<'static, [u8]>, value: T) -> bool
    where
        REv: From<StateStoreRequest>,
        T: Serialize,
    {
        match bincode::serialize(&value) {
            Ok(data) => {
                self.make_request(
                    move |responder| StateStoreRequest::Save {
                        key,
                        data,
                        responder,
                    },
                    QueueKind::Regular,
                )
                .await;
                true
            }
            Err(err) => {
                let type_name = type_name::<T>();
                warn!(%type_name, %err, "error serializing state");
                false
            }
        }
    }
pub ( crate ) async fn save_state < T > ( self , key : Cow < ' static , [ u8 ] > , value : T ) -> bool where REv : From < StateStoreRequest > , T : Serialize , { match bincode :: serialize ( & value ) { Ok ( data ) => { self . make_request ( move | responder | StateStoreRequest :: Save { key , data , responder , } , QueueKind :: Regular , ) . await ; true } Err ( err ) => { let type_name = type_name :: < T > ( ) ; warn ! ( type_name err " " ) ; false } } }
Save state to storage.
Save state to storage .
self
key
Cow<'static, [u8]>
value
T
self
key
Cow<'static, [u8]>
value
T