Enum iota_stronghold::Location[][src]

pub enum Location {
    Generic {
        vault_path: Vec<u8>,
        record_path: Vec<u8>,
    },
    Counter {
        vault_path: Vec<u8>,
        counter: usize,
    },
}

A Location type used to specify where in the Stronghold a piece of data should be stored. A generic location specifies a non-versioned location while a counter location specifies a versioned location. The Counter location can be used to get the head of the version chain by passing in None as the counter index. Otherwise, counter records are referenced through their associated index. On Read, the None location is the latest record in the version chain while on Write, the None location is the next record in the version chain.

Variants

Generic

Fields of Generic

vault_path: Vec<u8>record_path: Vec<u8>
Counter

Fields of Counter

vault_path: Vec<u8>counter: usize

Implementations

impl Location[src]

pub fn vault_path(&self) -> &[u8][src]

Gets the vault_path from the Location.

pub fn generic<V: Into<Vec<u8>>, R: Into<Vec<u8>>>(
    vault_path: V,
    record_path: R
) -> Self
[src]

Creates a generic location from types that implement Into<Vec<u8>>.

pub fn counter<V: Into<Vec<u8>>, C: Into<usize>>(
    vault_path: V,
    counter: C
) -> Self
[src]

Creates a counter location from a type that implements Into<Vec<u8>> and a counter type that implements Into<usize>

pub fn increment_counter(self) -> Self[src]

Helper method used to increment counter locations.

pub const fn const_generic(vault_path: Vec<u8>, record_path: Vec<u8>) -> Self[src]

Used to generate a constant generic location.

pub const fn const_counter(vault_path: Vec<u8>, counter: usize) -> Self[src]

used to generate a constant counter location.

Trait Implementations

impl AsRef<Location> for Location[src]

impl Clone for Location[src]

impl Debug for Location[src]

impl<'de> Deserialize<'de> for Location[src]

impl Serialize for Location[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ActorArgs for T where
    T: 'static + Clone + Send + Sync
[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Message for T where
    T: 'static + Debug + Clone + Send
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,