Skip to main content

write

Function write 

Source
pub fn write(
    key: impl Into<String>,
    value: impl Into<Vec<u8>>,
) -> impl Future<Output = Result<(), StorageError>> + 'static
Expand description

Stores value under key, replacing what was there.

The write is atomic: a crash or a power cut in the middle of it leaves either the old value or the new one. A value over MAX_VALUE_BYTES is refused with StorageError::TooLarge and the old value stays.