pub enum DecryptedMessage {
Text(Text),
Commit(Commit),
Proposal(Proposal),
}Expand description
Represents the potential items a consumer might require after passing us an encrypted message we have decrypted for him
Variants§
Text(Text)
The decrypted message is a text message.
Commit(Commit)
The decrypted message is a commit.
Proposal(Proposal)
The decrypted message is a proposal.
Implementations§
Source§impl DecryptedMessage
impl DecryptedMessage
Sourcepub fn is_text(&self) -> bool
pub fn is_text(&self) -> bool
Returns true if this is a DecryptedMessage::Text, otherwise false
Sourcepub fn as_text_mut(&mut self) -> Option<&mut Text>
pub fn as_text_mut(&mut self) -> Option<&mut Text>
Optionally returns mutable references to the inner fields if this is a DecryptedMessage::Text, otherwise None
Sourcepub fn as_text(&self) -> Option<&Text>
pub fn as_text(&self) -> Option<&Text>
Optionally returns references to the inner fields if this is a DecryptedMessage::Text, otherwise None
Sourcepub fn into_text(self) -> Result<Text, Self>
pub fn into_text(self) -> Result<Text, Self>
Returns the inner fields if this is a DecryptedMessage::Text, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_text_unchecked(self) -> Text
pub unsafe fn into_text_unchecked(self) -> Text
Unchecked return of the inner fields of DecryptedMessage::Text.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_text_unchecked(&self) -> &Text
pub unsafe fn as_text_unchecked(&self) -> &Text
Unchecked reference of the inner fields of DecryptedMessage::Text.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_text_mut_unchecked(&mut self) -> &mut Text
pub unsafe fn as_text_mut_unchecked(&mut self) -> &mut Text
Unchecked mutable reference of the inner fields of DecryptedMessage::Text.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_commit(&self) -> bool
pub fn is_commit(&self) -> bool
Returns true if this is a DecryptedMessage::Commit, otherwise false
Sourcepub fn as_commit_mut(&mut self) -> Option<&mut Commit>
pub fn as_commit_mut(&mut self) -> Option<&mut Commit>
Optionally returns mutable references to the inner fields if this is a DecryptedMessage::Commit, otherwise None
Sourcepub fn as_commit(&self) -> Option<&Commit>
pub fn as_commit(&self) -> Option<&Commit>
Optionally returns references to the inner fields if this is a DecryptedMessage::Commit, otherwise None
Sourcepub fn into_commit(self) -> Result<Commit, Self>
pub fn into_commit(self) -> Result<Commit, Self>
Returns the inner fields if this is a DecryptedMessage::Commit, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_commit_unchecked(self) -> Commit
pub unsafe fn into_commit_unchecked(self) -> Commit
Unchecked return of the inner fields of DecryptedMessage::Commit.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_commit_unchecked(&self) -> &Commit
pub unsafe fn as_commit_unchecked(&self) -> &Commit
Unchecked reference of the inner fields of DecryptedMessage::Commit.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_commit_mut_unchecked(&mut self) -> &mut Commit
pub unsafe fn as_commit_mut_unchecked(&mut self) -> &mut Commit
Unchecked mutable reference of the inner fields of DecryptedMessage::Commit.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_proposal(&self) -> bool
pub fn is_proposal(&self) -> bool
Returns true if this is a DecryptedMessage::Proposal, otherwise false
Sourcepub fn as_proposal_mut(&mut self) -> Option<&mut Proposal>
pub fn as_proposal_mut(&mut self) -> Option<&mut Proposal>
Optionally returns mutable references to the inner fields if this is a DecryptedMessage::Proposal, otherwise None
Sourcepub fn as_proposal(&self) -> Option<&Proposal>
pub fn as_proposal(&self) -> Option<&Proposal>
Optionally returns references to the inner fields if this is a DecryptedMessage::Proposal, otherwise None
Sourcepub fn into_proposal(self) -> Result<Proposal, Self>
pub fn into_proposal(self) -> Result<Proposal, Self>
Returns the inner fields if this is a DecryptedMessage::Proposal, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_proposal_unchecked(self) -> Proposal
pub unsafe fn into_proposal_unchecked(self) -> Proposal
Unchecked return of the inner fields of DecryptedMessage::Proposal.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_proposal_unchecked(&self) -> &Proposal
pub unsafe fn as_proposal_unchecked(&self) -> &Proposal
Unchecked reference of the inner fields of DecryptedMessage::Proposal.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_proposal_mut_unchecked(&mut self) -> &mut Proposal
pub unsafe fn as_proposal_mut_unchecked(&mut self) -> &mut Proposal
Unchecked mutable reference of the inner fields of DecryptedMessage::Proposal.
§Safety
Results in undefined behavior when it is the incorrect variant.
Source§impl DecryptedMessage
impl DecryptedMessage
Sourcepub fn identity(&self) -> &WireIdentity
pub fn identity(&self) -> &WireIdentity
Identity claims present in the sender credential
Trait Implementations§
Source§impl Debug for DecryptedMessage
impl Debug for DecryptedMessage
Source§impl From<BufferedDecryptedMessage> for DecryptedMessage
impl From<BufferedDecryptedMessage> for DecryptedMessage
Source§fn from(value: BufferedDecryptedMessage) -> Self
fn from(value: BufferedDecryptedMessage) -> Self
Source§impl From<DecryptedMessage> for BufferedDecryptedMessage
impl From<DecryptedMessage> for BufferedDecryptedMessage
Source§fn from(value: DecryptedMessage) -> Self
fn from(value: DecryptedMessage) -> Self
Auto Trait Implementations§
impl Freeze for DecryptedMessage
impl RefUnwindSafe for DecryptedMessage
impl Send for DecryptedMessage
impl Sync for DecryptedMessage
impl Unpin for DecryptedMessage
impl UnsafeUnpin for DecryptedMessage
impl UnwindSafe for DecryptedMessage
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> 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 more