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]
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<'de> Deserialize<'de> for MapInfo
[src]
impl<'de> Deserialize<'de> for MapInfo
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl StructuralEq for MapInfo
[src]
impl StructuralEq for MapInfo
[src]impl StructuralPartialEq for MapInfo
[src]
impl StructuralPartialEq for MapInfo
[src]Auto Trait Implementations
impl RefUnwindSafe for MapInfo
impl RefUnwindSafe for MapInfo
impl UnwindSafe for MapInfo
impl UnwindSafe for MapInfo
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,