pub async fn write<S>(&self, value: &S, write_through: bool) -> Result<(), PolicyError>
    where
        S: DeviceStorageCompatible,
    {
        if *value == self.read().await {
            return Ok(());
        }

        match self.storage.write(value, write_through).await {
            Ok(_) => Ok(()),
            Err(_) => Err(PolicyError::WriteFailure(self.policy_type)),
        }
    }
/// Returns Ok if the value was written, or an Error if the write failed. The argument
/// `write_through` will block returning until the value has been completely written to
/// persistent store, rather than any temporary in-memory caching.
Returns Ok if the value was written, or an Error if the write failed. The argument
`write_through` will block returning until the value has been completely written to
persistent store, rather than any temporary in-memory caching.
Returns Ok if the value was written or an Error if the write failed . The argument ` write_through ` will block returning until the value has been completely written to persistent store rather than any temporary in - memory caching .
pub async fn write<S>(&self, value: &S, write_through: bool) -> Result<(), PolicyError>
    where
        S: DeviceStorageCompatible,
    {
        if *value == self.read().await {
            return Ok(());
        }
        match self.storage.write(value, write_through).await {
            Ok(_) => Ok(()),
            Err(_) => Err(PolicyError::WriteFailure(self.policy_type)),
        }
    }
pub async fn write < S > ( & self , value : & S , write_through : bool ) -> Result < ( ) , PolicyError > where S : DeviceStorageCompatible , { if * value == self . read ( ) . await { return Ok ( ( ) ) ; } match self . storage . write ( value , write_through ) . await { Ok ( _ ) => Ok ( ( ) ) , Err ( _ ) => Err ( PolicyError :: WriteFailure ( self . policy_type ) ) , } }
Returns Ok if the value was written, or an Error if the write failed.
Returns Ok if the value was written or an Error if the write failed .
&self
value
&S
write_through
bool
&self
value
&S
write_through
bool