Trait StorageObj

Source
pub trait StorageObj {
    // Required methods
    fn create(id: &str, value: Vec<u8>) -> Self;
    fn create_with_hash(id: &str, value: Vec<u8>) -> Self;
    fn id(&self) -> &str;
    fn hash(&self) -> &Option<HashValue>;
    fn value(&self) -> &Vec<u8> ;
    fn value_mut(&mut self) -> &mut Vec<u8> ;
    fn update_value(&mut self, value: Vec<u8>) -> bool;
    fn into_value(self) -> Vec<u8> ;
    fn storage_id(&self) -> StorageId;
}

Required Methods§

Source

fn create(id: &str, value: Vec<u8>) -> Self

Source

fn create_with_hash(id: &str, value: Vec<u8>) -> Self

Source

fn id(&self) -> &str

Source

fn hash(&self) -> &Option<HashValue>

Source

fn value(&self) -> &Vec<u8>

Source

fn value_mut(&mut self) -> &mut Vec<u8>

Source

fn update_value(&mut self, value: Vec<u8>) -> bool

Source

fn into_value(self) -> Vec<u8>

Source

fn storage_id(&self) -> StorageId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§