[][src]Struct safe_app::MDataInfo

pub struct MDataInfo {
    pub address: Address,
    pub enc_info: Option<(Key, [u8; 16])>,
    pub new_enc_info: Option<(Key, [u8; 16])>,
}

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

Fields

address: Address

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

enc_info: Option<(Key, [u8; 16])>

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

new_enc_info: Option<(Key, [u8; 16])>

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

Methods

impl MDataInfo[src]

pub fn new_private(address: Address, enc_info: (Key, [u8; 16])) -> MDataInfo[src]

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

pub fn new_public(address: Address) -> MDataInfo[src]

Construct MDataInfo for public data.

pub fn random_private(kind: Kind, type_tag: u64) -> Result<MDataInfo, CoreError>[src]

Generate random MDataInfo for private (encrypted) mutable data.

pub fn random_public(kind: Kind, type_tag: u64) -> Result<MDataInfo, CoreError>[src]

Generate random MDataInfo 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) -> &Address[src]

Returns the address of the data.

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

Returns the kind.

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

Returns the encryption key, if any.

pub fn nonce(&self) -> Option<&[u8; 16]>[src]

Returns the nonce, if any.

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

Encrypt the key for the mdata entry accordingly.

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

Encrypt the value for this mdata entry accordingly.

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

Decrypt key or value of this mdata 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).

pub fn into_repr_c(self) -> MDataInfo[src]

Construct FFI wrapper for the native Rust object, consuming self.

Trait Implementations

impl Clone for MDataInfo[src]

impl Debug for MDataInfo[src]

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

impl Eq for MDataInfo[src]

impl PartialEq<MDataInfo> for MDataInfo[src]

impl ReprC for MDataInfo[src]

type C = *const MDataInfo

C representation of the type.

type Error = IpcError

Error type.

impl Serialize for MDataInfo[src]

impl StructuralEq for MDataInfo[src]

impl StructuralPartialEq for MDataInfo[src]

Auto Trait Implementations

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> CloneAny for T where
    T: Clone + Any

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> 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<T> UnsafeAny for T where
    T: Any

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