pub struct DocumentChain { /* private fields */ }Expand description
Holds an IntegrationChain and its corresponding DiffChain that can be used to resolve the
latest version of a ResolvedIotaDocument.
Implementations§
Source§impl DocumentChain
impl DocumentChain
Sourcepub fn new(chain_i: IntegrationChain) -> Self
pub fn new(chain_i: IntegrationChain) -> Self
Creates a new DocumentChain from the given IntegrationChain.
Sourcepub fn new_with_diff_chain(
chain_i: IntegrationChain,
chain_d: DiffChain,
) -> Result<Self>
👎Deprecated since 0.5.0: diff chain features are slated for removal
pub fn new_with_diff_chain( chain_i: IntegrationChain, chain_d: DiffChain, ) -> Result<Self>
Creates a new DocumentChain from given the IntegrationChain and DiffChain.
Sourcepub fn id(&self) -> &IotaDID
pub fn id(&self) -> &IotaDID
Returns a reference to the IotaDID identifying this document chain.
Sourcepub fn integration_chain(&self) -> &IntegrationChain
pub fn integration_chain(&self) -> &IntegrationChain
Returns a reference to the IntegrationChain.
Sourcepub fn integration_chain_mut(&mut self) -> &mut IntegrationChain
pub fn integration_chain_mut(&mut self) -> &mut IntegrationChain
Returns a mutable reference to the IntegrationChain.
Sourcepub fn diff(&self) -> &DiffChain
👎Deprecated since 0.5.0: diff chain features are slated for removal
pub fn diff(&self) -> &DiffChain
Returns a reference to the DiffChain.
Sourcepub fn diff_mut(&mut self) -> &mut DiffChain
👎Deprecated since 0.5.0: diff chain features are slated for removal
pub fn diff_mut(&mut self) -> &mut DiffChain
Returns a mutable reference to the DiffChain.
Sourcepub fn fold(self) -> Result<ResolvedIotaDocument>
pub fn fold(self) -> Result<ResolvedIotaDocument>
Merges the changes from the DiffChain into the current ResolvedIotaDocument from
the IntegrationChain.
Sourcepub fn current(&self) -> &ResolvedIotaDocument
pub fn current(&self) -> &ResolvedIotaDocument
Returns a reference to the latest ResolvedIotaDocument.
Sourcepub fn current_mut(&mut self) -> &mut ResolvedIotaDocument
pub fn current_mut(&mut self) -> &mut ResolvedIotaDocument
Returns a mutable reference to the latest ResolvedIotaDocument.
Sourcepub fn integration_message_id(&self) -> &MessageId
pub fn integration_message_id(&self) -> &MessageId
Returns the Tangle MessageId of the latest integration ResolvedIotaDocument.
Sourcepub fn diff_message_id(&self) -> &MessageId
👎Deprecated since 0.5.0: diff chain features are slated for removal
pub fn diff_message_id(&self) -> &MessageId
Returns the Tangle MessageId of the latest diff or integration ResolvedIotaDocument.
Sourcepub fn try_push_integration(
&mut self,
document: ResolvedIotaDocument,
) -> Result<()>
pub fn try_push_integration( &mut self, document: ResolvedIotaDocument, ) -> Result<()>
Adds a new integration document to the chain.
§Errors
Fails if the document is not a valid integration document.
Sourcepub fn try_push_diff(&mut self, diff: DiffMessage) -> Result<()>
👎Deprecated since 0.5.0: diff chain features are slated for removal
pub fn try_push_diff(&mut self, diff: DiffMessage) -> Result<()>
Trait Implementations§
Source§impl Clone for DocumentChain
impl Clone for DocumentChain
Source§fn clone(&self) -> DocumentChain
fn clone(&self) -> DocumentChain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DocumentChain
impl Debug for DocumentChain
Source§impl<'de> Deserialize<'de> for DocumentChain
impl<'de> Deserialize<'de> for DocumentChain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for DocumentChain
impl Display for DocumentChain
Auto Trait Implementations§
impl !Freeze for DocumentChain
impl RefUnwindSafe for DocumentChain
impl Send for DocumentChain
impl Sync for DocumentChain
impl Unpin for DocumentChain
impl UnwindSafe for DocumentChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
Source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self from a string of JSON text.Source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self from bytes of JSON text.Source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self from a serde_json::Value.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
Source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self as a serde_json::Value.