Struct SharedStorage

Source
pub struct SharedStorage<Value: Clone> { /* private fields */ }
Expand description

A shared storage.

§Type Parameters

  • Value - A value type.

Implementations§

Source§

impl<Value: Clone + 'static> SharedStorage<Value>

Source

pub fn new() -> Self

Creates a shared storage.

Source

pub fn new_with_reader( reader: &mut dyn Read, value_deserializer: &mut ValueDeserializer<Value>, ) -> Result<Self, Error>

Creates a shared storage.

§Arguments
  • reader - A reader.
  • value_deserializer - A deserializer for value objects.
§Errors
  • When it fails to read the memory.

Trait Implementations§

Source§

impl<Value: Debug + Clone> Debug for SharedStorage<Value>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Value: Default + Clone> Default for SharedStorage<Value>

Source§

fn default() -> SharedStorage<Value>

Returns the “default value” for a type. Read more
Source§

impl<Value: Clone + Debug + 'static> Storage<Value> for SharedStorage<Value>

Source§

fn base_check_size(&self) -> Result<usize, Error>

Returns the base-check size. Read more
Source§

fn base_at(&self, base_check_index: usize) -> Result<i32, Error>

Returns the base value. Read more
Source§

fn set_base_at( &mut self, base_check_index: usize, base: i32, ) -> Result<(), Error>

Sets a base value. Read more
Source§

fn check_at(&self, base_check_index: usize) -> Result<u8, Error>

Return the check value. Read more
Source§

fn set_check_at( &mut self, base_check_index: usize, check: u8, ) -> Result<(), Error>

Sets a check value. Read more
Source§

fn value_count(&self) -> Result<usize, Error>

Returns the value count. Read more
Source§

fn value_at(&self, value_index: usize) -> Result<Option<Rc<Value>>, Error>

Returns the value object. Read more
Source§

fn add_value_at( &mut self, value_index: usize, value: Value, ) -> Result<(), Error>

Adds a value object. Read more
Source§

fn filling_rate(&self) -> Result<f64, Error>

Returns the filling rate. Read more
Source§

fn serialize( &self, writer: &mut dyn Write, value_serializer: &mut ValueSerializer<'_, Value>, ) -> Result<(), Error>

Serializes this storage. Read more
Source§

fn clone_box(&self) -> Box<dyn Storage<Value>>

Clones this storage as Box. Read more
Source§

fn as_any(&self) -> &dyn Any

Returns this object as ‘Any’. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns this mutable object as ‘Any’. Read more

Auto Trait Implementations§

§

impl<Value> Freeze for SharedStorage<Value>

§

impl<Value> !RefUnwindSafe for SharedStorage<Value>

§

impl<Value> !Send for SharedStorage<Value>

§

impl<Value> !Sync for SharedStorage<Value>

§

impl<Value> Unpin for SharedStorage<Value>

§

impl<Value> !UnwindSafe for SharedStorage<Value>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.