pub struct Response {
pub status_code: StatusCode,
pub version: Version,
pub headers: Headers,
pub body: Vec<u8>,
}
Expand description
Response reprsents a SIP response message, which contains a StatusCode,
a Version, Headers and a
body, represented as a Vec<u8>
, thus not checked for UTF-8 compliance.
A Response 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 Response implements it.
Fields§
§status_code: StatusCode
§version: Version
§headers: Headers
§body: Vec<u8>
Implementations§
Trait Implementations§
Source§impl From<Response> for SipMessage
impl From<Response> for SipMessage
Source§impl HasHeaders for Response
impl HasHeaders for Response
Source§impl HeadersExt for Response
impl HeadersExt for Response
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<Option<Branch>, Error>
Source§impl TryFrom<SipMessage> for Response
impl TryFrom<SipMessage> for Response
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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