[][src]Struct safety_rules::PersistentSafetyStorage

pub struct PersistentSafetyStorage { /* fields omitted */ }

SafetyRules needs an abstract storage interface to act as a common utility for storing persistent data to local disk, cloud, secrets managers, or even memory (for tests) Any set function is expected to sync to the remote system before returning.

Note: cached_safety_data is a local in-memory copy of SafetyData. As SafetyData should only ever be used by safety rules, we maintain an in-memory copy to avoid issuing reads to the internal storage if the SafetyData hasn't changed. On writes, we update the cache and internal storage.

Implementations

impl PersistentSafetyStorage[src]

pub fn initialize(
    internal_store: Storage,
    author: Author,
    consensus_private_key: Ed25519PrivateKey,
    execution_private_key: Ed25519PrivateKey,
    waypoint: Waypoint,
    enable_cached_safety_data: bool
) -> Self
[src]

Use this to instantiate a PersistentStorage for a new data store, one that has no SafetyRules values set.

pub fn new(internal_store: Storage, enable_cached_safety_data: bool) -> Self[src]

Use this to instantiate a PersistentStorage with an existing data store. This is intended for constructed environments.

pub fn author(&self) -> Result<Author, Error>[src]

pub fn consensus_key_for_version(
    &self,
    version: Ed25519PublicKey
) -> Result<Ed25519PrivateKey, Error>
[src]

pub fn execution_public_key(&self) -> Result<Ed25519PublicKey, Error>[src]

pub fn safety_data(&mut self) -> Result<SafetyData, Error>[src]

pub fn set_safety_data(&mut self, data: SafetyData) -> Result<(), Error>[src]

pub fn waypoint(&self) -> Result<Waypoint, Error>[src]

pub fn set_waypoint(&mut self, waypoint: &Waypoint) -> Result<(), Error>[src]

pub fn internal_store(&mut self) -> &mut Storage[src]

Auto Trait Implementations

impl RefUnwindSafe for PersistentSafetyStorage

impl Send for PersistentSafetyStorage

impl Sync for PersistentSafetyStorage

impl Unpin for PersistentSafetyStorage

impl UnwindSafe for PersistentSafetyStorage

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,