Enum routing::AppendWrapper
[−]
[src]
pub enum AppendWrapper { Pub { append_to: XorName, data: AppendedData, version: u64, }, Priv { append_to: XorName, data: PrivAppendedData, sign_key: PublicKey, version: u64, signature: Signature, }, }
An AppendedData
item, together with the identifier of the data to append it to.
Variants
Pub
A wrapper for public appendable data.
Fields of Pub
append_to: XorName | The name of the data chunk to add to. |
data: AppendedData | The item to add to the chunk. |
version: u64 | The current version of the chunk. |
Priv
A wrapper for private appendable data.
Fields of Priv
append_to: XorName | The name of the data chunk to add to. |
data: PrivAppendedData | The item to add to the chunk. |
sign_key: PublicKey | The signer's public_key. |
version: u64 | The current version of the chunk. |
signature: Signature | All the above fields |
Methods
impl AppendWrapper
[src]
fn new_pub(append_to: XorName, data: AppendedData, version: u64) -> Self
Returns a new append wrapper for public data.
fn new_priv(append_to: XorName,
data: PrivAppendedData,
sign_pair: (&PublicKey, &SecretKey),
version: u64)
-> Result<AppendWrapper, RoutingError>
data: PrivAppendedData,
sign_pair: (&PublicKey, &SecretKey),
version: u64)
-> Result<AppendWrapper, RoutingError>
Returns a new, signed append wrapper for private data.
fn identifier(&self) -> DataIdentifier
Returns the identifier of the data to append to.
fn verify_signature(&self) -> bool
Returns true
if the signature matches the data.
fn sign_key(&self) -> &PublicKey
Returns sign_key
of the signer.
fn version(&self) -> &u64
Returns version
of the wrapper item.
fn priv_appended_data(&self) -> Option<&PrivAppendedData>
Returns priv_appended_data
if AppendWrapper::Priv.
fn pub_appended_data(&self) -> Option<&AppendedData>
Returns pub_appended_data
if AppendWrapper::Pub.
Trait Implementations
impl Hash for AppendWrapper
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Eq for AppendWrapper
[src]
impl PartialEq for AppendWrapper
[src]
fn eq(&self, __arg_0: &AppendWrapper) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AppendWrapper) -> bool
This method tests for !=
.
impl PartialOrd for AppendWrapper
[src]
fn partial_cmp(&self, __arg_0: &AppendWrapper) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &AppendWrapper) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &AppendWrapper) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &AppendWrapper) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &AppendWrapper) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for AppendWrapper
[src]
fn cmp(&self, __arg_0: &AppendWrapper) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl Clone for AppendWrapper
[src]
fn clone(&self) -> AppendWrapper
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Decodable for AppendWrapper
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<AppendWrapper, __D::Error>
Deserialize a value using a Decoder
.
impl Encodable for AppendWrapper
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
Serialize a value using an Encoder
.