Struct SuccessResponse

Source
pub struct SuccessResponse<A>(/* private fields */);
Expand description

Success response message.

Implementations§

Source§

impl<A: Attribute> SuccessResponse<A>

Source

pub fn new(request: &Request<A>) -> Self

Makes a new SuccessResponse instance for the success response to the given request.

Source

pub fn from_message(message: Message<A>) -> MessageResult<Self>

Converts Message to SuccessResponse.

§Errors

If the class of the given message is not MessageClass::SuccessResponse, this function will return a MessageErrorKind::InvalidInput error.

And if the message contains some unknown comprehension-required attributes, this function will return a MessageErrorKind::UnknownAttributes error.

Source

pub fn method(&self) -> Method

Returns the method of the message.

Source

pub fn transaction_id(&self) -> TransactionId

Returns the transaction ID of the message.

Source

pub fn get_attribute<T>(&self) -> Option<&T>
where T: Attribute, A: TryAsRef<T>,

Returns a reference to the first occurance of T attribute in the attributes of the message.

If there is no such attribute, this method will return None.

Source

pub fn attributes(&self) -> impl Iterator<Item = &A>

Returns an iterator that iterates over the known attributes in the message.

Source

pub fn add_attribute(&mut self, attribute: A)

Adds the given attribute to the tail of the attributes in the message.

Source

pub fn into_message(self) -> Message<A>

Takes ownership of this instance, and returns the internal message.

Trait Implementations§

Source§

impl<A: Attribute> AsMut<Message<A>> for SuccessResponse<A>

Source§

fn as_mut(&mut self) -> &mut Message<A>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<A: Attribute> AsRef<Message<A>> for SuccessResponse<A>

Source§

fn as_ref(&self) -> &Message<A>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<A: Clone> Clone for SuccessResponse<A>

Source§

fn clone(&self) -> SuccessResponse<A>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Debug> Debug for SuccessResponse<A>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> Freeze for SuccessResponse<A>

§

impl<A> RefUnwindSafe for SuccessResponse<A>
where A: RefUnwindSafe,

§

impl<A> Send for SuccessResponse<A>
where A: Send,

§

impl<A> Sync for SuccessResponse<A>
where A: Sync,

§

impl<A> Unpin for SuccessResponse<A>
where A: Unpin,

§

impl<A> UnwindSafe for SuccessResponse<A>
where A: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

fn vzip(self) -> V