Struct noosphere_core::view::SphereMutation
source · pub struct SphereMutation { /* private fields */ }Expand description
A SphereMutation is created and modified in order to describe changes to a Sphere. After initializing the SphereMutation, changes to the sphere are made to it and then it is “applied” to the Sphere to produce a SphereRevision, which may then be signed.
Implementations§
source§impl SphereMutation
impl SphereMutation
sourcepub fn new(did: &str) -> Self
pub fn new(did: &str) -> Self
Initialize a new SphereMutation with the Did of the author of the mutation
Get the identity of the author of this mutation
sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the state of the SphereMutation, so that it may be re-used without being recreated. This is sometimes useful if the code that is working with the SphereMutation does not have sufficient information to set the author Did for a new SphereMutation.
sourcepub fn content_mut(&mut self) -> &mut ContentMutation
pub fn content_mut(&mut self) -> &mut ContentMutation
A mutable reference to the changes to sphere content, given as a ContentMutation
sourcepub fn content(&self) -> &ContentMutation
pub fn content(&self) -> &ContentMutation
An immutable reference to the changes to sphere content, given as a ContentMutation
sourcepub fn identities_mut(&mut self) -> &mut IdentitiesMutation
pub fn identities_mut(&mut self) -> &mut IdentitiesMutation
A mutable reference to the changes to sphere identities (petnames), given as a IdentitiesMutation
sourcepub fn identities(&self) -> &IdentitiesMutation
pub fn identities(&self) -> &IdentitiesMutation
An immutable reference to the changes to sphere identities (petnames), given as a IdentitiesMutation
sourcepub fn delegations_mut(&mut self) -> &mut DelegationsMutation
pub fn delegations_mut(&mut self) -> &mut DelegationsMutation
A mutable reference to the changes to sphere delegations (of authority), given as a DelegationsMutation
sourcepub fn delegations(&self) -> &DelegationsMutation
pub fn delegations(&self) -> &DelegationsMutation
An immutable reference to the changes to sphere delegations (of authority), given as a DelegationsMutation
sourcepub fn revocations_mut(&mut self) -> &mut RevocationsMutation
pub fn revocations_mut(&mut self) -> &mut RevocationsMutation
A mutable reference to the changes to sphere revocations (of authority), given as a RevocationsMutation
sourcepub fn revocations(&self) -> &RevocationsMutation
pub fn revocations(&self) -> &RevocationsMutation
An immutable reference to the changes to sphere revocations (of authority), given as a RevocationsMutation
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if no new changes would be made by applying this mutation to a Sphere. Otherwise, false.
sourcepub fn append(&mut self, other: SphereMutation)
pub fn append(&mut self, other: SphereMutation)
Consume a SphereMutation, appending its changes to this one