Skip to main content

DecryptedMessage

Enum DecryptedMessage 

Source
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

Source

pub fn is_text(&self) -> bool

Returns true if this is a DecryptedMessage::Text, otherwise false

Source

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

Source

pub fn as_text(&self) -> Option<&Text>

Optionally returns references to the inner fields if this is a DecryptedMessage::Text, otherwise None

Source

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

Source

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.

Source

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.

Source

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.

Source

pub fn is_commit(&self) -> bool

Returns true if this is a DecryptedMessage::Commit, otherwise false

Source

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

Source

pub fn as_commit(&self) -> Option<&Commit>

Optionally returns references to the inner fields if this is a DecryptedMessage::Commit, otherwise None

Source

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

Source

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.

Source

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.

Source

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.

Source

pub fn is_proposal(&self) -> bool

Returns true if this is a DecryptedMessage::Proposal, otherwise false

Source

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

Source

pub fn as_proposal(&self) -> Option<&Proposal>

Optionally returns references to the inner fields if this is a DecryptedMessage::Proposal, otherwise None

Source

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

Source

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.

Source

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.

Source

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

Source

pub fn identity(&self) -> &WireIdentity

Identity claims present in the sender credential

Trait Implementations§

Source§

impl Debug for DecryptedMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BufferedDecryptedMessage> for DecryptedMessage

Source§

fn from(value: BufferedDecryptedMessage) -> Self

Converts to this type from the input type.
Source§

impl From<DecryptedMessage> for BufferedDecryptedMessage

Source§

fn from(value: DecryptedMessage) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T