Skip to main content

PersistenceStorageComponent

Struct PersistenceStorageComponent 

Source
pub struct PersistenceStorageComponent { /* private fields */ }
Expand description

PersistenceStorageComponent — production-ready CCM-Component.

Implementations§

Source§

impl PersistenceStorageComponent

Source

pub fn new() -> Self

Konstruktor.

Source

pub fn create( &mut self, oid: Vec<u8>, state: Vec<u8>, ) -> Result<(), PersistenceError>

create — Spec PSS §10.3.2 (StorageHomeBase::create).

§Errors

DuplicateOid wenn die oid schon existiert.

Source

pub fn find(&self, oid: &[u8]) -> Option<&StorageEntry>

find — Spec PSS §10.3.4 (StorageHomeBase::find_by_short_pid).

Source

pub fn update( &mut self, oid: &[u8], new_state: Vec<u8>, ) -> Result<(), PersistenceError>

update — modifiziert State, markiert dirty.

§Errors

NotFound wenn die oid unbekannt ist.

Source

pub fn destroy(&mut self, oid: &[u8]) -> Result<(), PersistenceError>

destroy — Spec PSS §10.3.5 (StorageObjectBase::destroy).

§Errors

NotFound wenn die oid unbekannt ist.

Source

pub fn flush(&mut self) -> u64

flush — Spec PSS §10.4.1 (Catalog::flush). Resettet alle dirty-Flags und inkrementiert den Flush-Counter.

Source

pub fn len(&self) -> usize

Anzahl der Storage-Entries.

Source

pub fn is_empty(&self) -> bool

Liefert true wenn keine Eintraege vorhanden sind.

Source

pub fn flush_count(&self) -> u64

Liefert die aktuelle Flush-Anzahl.

Source

pub fn dirty_count(&self) -> usize

Liefert die Anzahl dirty Eintraege.

Source

pub fn is_active(&self) -> bool

Liefert true wenn aktiviert.

Trait Implementations§

Source§

impl ComponentExecutor for PersistenceStorageComponent

Source§

fn set_context(&mut self, context: Box<dyn ComponentContext>)

set_session_context / set_service_context etc. — der Container injiziert den Context vor dem ersten Method-Call (Spec §8.1.5).
Source§

fn ccm_activate(&mut self) -> Result<(), CifError>

ccm_activate — Spec §8.1.5.4.
Source§

fn ccm_passivate(&mut self) -> Result<(), CifError>

ccm_passivate — Spec §8.1.5.5.
Source§

fn ccm_remove(&mut self) -> Result<(), CifError>

ccm_remove — Spec §8.1.5.6.
Source§

impl Debug for PersistenceStorageComponent

Source§

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

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

impl Default for PersistenceStorageComponent

Source§

fn default() -> PersistenceStorageComponent

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

Auto Trait Implementations§

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.