Struct rustun::message::Request
[−]
[src]
pub struct Request<M, A> { /* fields omitted */ }
Request message.
Methods
impl<M, A> Request<M, A> where M: Method, A: Attribute
[src]
fn new(method: M) -> Self where M: Requestable
Makes a new request message.
fn add_attribute<T: Into<A>>(&mut self, attribute: T) -> &mut Self
Adds attribute
to the tail of the attributes of this message.
fn with_attribute<T: Into<A>>(self, attribute: T) -> Self
Adds attribute
to the tail of the attributes of this message.
fn method(&self) -> &M
Returns the method of this message.
fn transaction_id(&self) -> &TransactionId
Returns the transaction ID of this message.
fn attributes(&self) -> &[A]
Returns the attributes of this message.
fn into_success_response(self) -> SuccessResponse<M, A>
Converts into a success response message.
fn into_error_response(self) -> ErrorResponse<M, A>
Converts into an error response message.
Trait Implementations
impl<M: Debug, A: Debug> Debug for Request<M, A>
[src]
impl<M: Clone, A: Clone> Clone for Request<M, A>
[src]
fn clone(&self) -> Request<M, A>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<M: Method, A: Attribute> Message for Request<M, A>
[src]
type Method = M
STUN method type of this implementation.
type Attribute = A
STUN attribute type of this implementation.
fn get_class(&self) -> Class
Returns the class of this message.
fn get_method(&self) -> &Self::Method
Returns the method of this message.
fn get_transaction_id(&self) -> &TransactionId
Returns the transaction ID of this message.
fn get_attributes(&self) -> &[Self::Attribute]
Returns the attributes of this message.
fn get_attribute<A>(&self) -> Option<&A> where Self::Attribute: TryAsRef<A>
Returns the reference to the specified attribute if it exists in the attributes of this method. Read more
fn try_to_raw(&self) -> Result<RawMessage, Error>
Tries to convert to RawMessage
.