pub struct Request {
pub method: Method,
pub uri: Uri,
pub version: Version,
pub headers: Headers,
pub body: Vec<u8>,
}Expand description
Request reprsents a SIP request message, which contains a Method,
a Uri, a Version, Headers and a
body, represented as a Vec<u8>, thus not checked for UTF-8 compliance.
A Request can easily be transformed to a SipMessage.
Also it can be converted to a String, &str, or Bytes, all using the underlying Debug
trait.
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 Request implements it.
Fields§
§method: Method§uri: Uri§version: Version§headers: Headers§body: Vec<u8>Implementations§
Trait Implementations§
Source§impl From<Request> for SipMessage
impl From<Request> for SipMessage
Source§impl HasHeaders for Request
impl HasHeaders for Request
Source§impl HeadersExt for Request
impl HeadersExt for Request
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>
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<Branch, Error>
Source§impl TryFrom<SipMessage> for Request
impl TryFrom<SipMessage> for Request
impl Eq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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
Mutably borrows from an owned value. Read more