Enum rsip::message::sip_message::SipMessage
source · [−]Expand description
SipMessage reprsents a generic SIP message, which could either be a Request or a Response.
A SipMessage can be converted to a String
, &str
, or Bytes
, all using the underlying Debug
trait.
A SipMessage can be taken using the TryFrom
convertions from a String
, an &str
or
Bytes
, all using the underlying Tokenizer. If a convertion fails, the tokenizer will give you
a relevant underlying nom error wrapped in rsip::Error.
In order to access specific headers, you should take a look on the HeadersExt trait that is automatically implemented for any type that has implemented the HasHeaders trait, which SipMessage implements it.
Variants
Request(Request)
Response(Response)
Implementations
sourceimpl SipMessage
impl SipMessage
pub fn is_request(&self) -> bool
pub fn is_response(&self) -> bool
pub fn version(&self) -> &Version
pub fn body(&self) -> &Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn body_mut(&mut self) -> &mut Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trait Implementations
sourceimpl Clone for SipMessage
impl Clone for SipMessage
sourcefn clone(&self) -> SipMessage
fn clone(&self) -> SipMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SipMessage
impl Debug for SipMessage
sourceimpl Display for SipMessage
impl Display for SipMessage
sourceimpl From<Request> for SipMessage
impl From<Request> for SipMessage
sourceimpl From<Response> for SipMessage
impl From<Response> for SipMessage
sourceimpl From<SipMessage> for String
impl From<SipMessage> for String
sourcefn from(msg: SipMessage) -> Self
fn from(msg: SipMessage) -> Self
Converts to this type from the input type.
sourceimpl From<SipMessage> for Vec<u8>
impl From<SipMessage> for Vec<u8>
sourcefn from(msg: SipMessage) -> Self
fn from(msg: SipMessage) -> Self
Converts to this type from the input type.
sourceimpl From<SipMessage> for Bytes
impl From<SipMessage> for Bytes
sourcefn from(msg: SipMessage) -> Self
fn from(msg: SipMessage) -> Self
Converts to this type from the input type.
sourceimpl HasHeaders for SipMessage
impl HasHeaders for SipMessage
sourceimpl HeadersExt for SipMessage
impl HeadersExt for SipMessage
fn to_header(&self) -> Result<&To, Error>
fn to_header_mut(&mut self) -> Result<&mut To, Error>
fn from_header(&self) -> Result<&From, Error>
fn from_header_mut(&mut self) -> Result<&mut From, Error>
fn via_header(&self) -> Result<&Via, Error>
fn via_header_mut(&mut self) -> Result<&mut Via, Error>
fn call_id_header(&self) -> Result<&CallId, Error>
fn call_id_header_mut(&mut self) -> Result<&mut CallId, Error>
fn cseq_header(&self) -> Result<&CSeq, Error>
fn cseq_header_mut(&mut self) -> Result<&mut CSeq, Error>
fn max_forwards_header(&self) -> Result<&MaxForwards, Error>
fn max_forwards_header_mut(&mut self) -> Result<&mut MaxForwards, Error>
fn contact_header(&self) -> Result<&Contact, Error>
fn contact_header_mut(&mut self) -> Result<&mut Contact, Error>
fn contact_headers(&self) -> Vec<&Contact>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn record_route_header(&self) -> Option<&RecordRoute>
fn route_header(&self) -> Option<&Route>
fn user_agent_header(&self) -> Option<&UserAgent>
fn www_authenticate_header(&self) -> Option<&WwwAuthenticate>
fn expires_header(&self) -> Option<&Expires>
fn min_expires_header(&self) -> Option<&MinExpires>
fn transaction_id(&self) -> Result<Option<Branch>, Error>
sourceimpl PartialEq<SipMessage> for SipMessage
impl PartialEq<SipMessage> for SipMessage
sourcefn eq(&self, other: &SipMessage) -> bool
fn eq(&self, other: &SipMessage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SipMessage) -> bool
fn ne(&self, other: &SipMessage) -> bool
This method tests for !=
.
sourceimpl TryFrom<&'_ str> for SipMessage
impl TryFrom<&'_ str> for SipMessage
sourceimpl TryFrom<Bytes> for SipMessage
impl TryFrom<Bytes> for SipMessage
sourceimpl TryFrom<SipMessage> for Request
impl TryFrom<SipMessage> for Request
sourceimpl TryFrom<SipMessage> for Response
impl TryFrom<SipMessage> for Response
sourceimpl TryFrom<String> for SipMessage
impl TryFrom<String> for SipMessage
impl Eq for SipMessage
impl StructuralEq for SipMessage
impl StructuralPartialEq for SipMessage
Auto Trait Implementations
impl RefUnwindSafe for SipMessage
impl Send for SipMessage
impl Sync for SipMessage
impl Unpin for SipMessage
impl UnwindSafe for SipMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more