Struct sn_client::client::map_info::MapInfo [−][src]
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for MapInfo
[src]
impl PartialEq<MapInfo> for MapInfo
[src]
impl Serialize for MapInfo
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for MapInfo
[src]
impl StructuralPartialEq for MapInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for MapInfo
[src]
impl Send for MapInfo
[src]
impl Sync for MapInfo
[src]
impl Unpin for MapInfo
[src]
impl UnwindSafe for MapInfo
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> 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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,