[−][src]Struct safe_app::mdata_info::MDataInfo
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.
Implementations
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]
fn deserialize<__D>(
__deserializer: __D
) -> Result<MDataInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<MDataInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
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.
unsafe fn clone_from_repr_c(
repr_c: <MDataInfo as ReprC>::C
) -> Result<MDataInfo, <MDataInfo as ReprC>::Error>
[src]
repr_c: <MDataInfo as ReprC>::C
) -> Result<MDataInfo, <MDataInfo as ReprC>::Error>
impl Serialize for MDataInfo
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for MDataInfo
[src]
impl StructuralPartialEq for MDataInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for MDataInfo
impl Send for MDataInfo
impl Sync for MDataInfo
impl Unpin for MDataInfo
impl UnwindSafe for MDataInfo
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
T: Send + Sync,
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[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.
fn to_owned(&self) -> T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,