Struct sn_client::client::map_info::MapInfo[][src]

pub struct MapInfo {
    pub address: MapAddress,
    pub enc_info: Option<(Key, SymEncNonce)>,
    pub new_enc_info: Option<(Key, SymEncNonce)>,
}

Information allowing to locate and access mutable data on the network.

Fields

address: MapAddress

Address of the mutable data, containing its name, type tag, and whether it is sequenced.

enc_info: Option<(Key, SymEncNonce)>

Key to encrypt/decrypt the directory content and the nonce to be used for keys

new_enc_info: Option<(Key, SymEncNonce)>

Future encryption info, used for two-phase data reencryption.

Implementations

impl MapInfo[src]

pub fn new_private(address: MapAddress, enc_info: (Key, SymEncNonce)) -> Self[src]

Construct MapInfo for private (encrypted) data with a provided private key.

pub fn new_public(address: MapAddress) -> Self[src]

Construct MapInfo for public data.

pub fn random_private(kind: MapKind, type_tag: u64) -> Result<Self, Error>[src]

Generate random MapInfo for private (encrypted) mutable data.

pub fn random_public(kind: MapKind, type_tag: u64) -> Result<Self, Error>[src]

Generate random MapInfo for public mutable data.

pub fn name(&self) -> XorName[src]

Returns the name.

pub fn type_tag(&self) -> u64[src]

Returns the type tag.

pub fn address(&self) -> &MapAddress[src]

Returns the address of the data.

pub fn kind(&self) -> MapKind[src]

Returns the kind.

pub fn enc_key(&self) -> Option<&Key>[src]

Returns the encryption key, if any.

pub fn nonce(&self) -> Option<&SymEncNonce>[src]

Returns the nonce, if any.

pub fn enc_entry_key(&self, plain_text: &[u8]) -> Result<Vec<u8>, Error>[src]

Encrypt the key for the map entry accordingly.

pub fn enc_entry_value(&self, plain_text: &[u8]) -> Result<Vec<u8>, Error>[src]

Encrypt the value for this map entry accordingly.

pub fn decrypt(&self, cipher: &[u8]) -> Result<Vec<u8>, Error>[src]

Decrypt key or value of this map entry.

pub fn start_new_enc_info(&mut self)[src]

Start the encryption info re-generation by populating the new_enc_info field with random keys, unless it's already populated.

pub fn commit_new_enc_info(&mut self)[src]

Commit the encryption info re-generation by replacing the current encryption info with new_enc_info (if any).

Trait Implementations

impl Clone for MapInfo[src]

impl Debug for MapInfo[src]

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

impl Eq for MapInfo[src]

impl PartialEq<MapInfo> for MapInfo[src]

impl Serialize for MapInfo[src]

impl StructuralEq for MapInfo[src]

impl StructuralPartialEq for MapInfo[src]

Auto Trait Implementations

impl RefUnwindSafe for MapInfo

impl Send for MapInfo

impl Sync for MapInfo

impl Unpin for MapInfo

impl UnwindSafe for MapInfo

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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