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
sourceimpl Response
impl Response
pub fn status_code(&self) -> &StatusCode
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<Response> for SipMessage
impl From<Response> for SipMessage
sourceimpl HasHeaders for Response
impl HasHeaders for Response
sourceimpl 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>ⓘ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 Response
impl TryFrom<SipMessage> for Response
impl Eq for Response
impl StructuralEq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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