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
sourceimpl Request
impl Request
pub fn method(&self) -> &Method
pub fn uri(&self) -> &Uri
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 From<Request> for SipMessage
impl From<Request> for SipMessage
sourceimpl HasHeaders for Request
impl HasHeaders for Request
sourceimpl 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>ⓘ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 TryFrom<SipMessage> for Request
impl TryFrom<SipMessage> for Request
impl Eq for Request
impl StructuralEq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more