Struct eventsource_client::Response
source · pub struct Response { /* private fields */ }
Implementations§
source§impl Response
impl Response
pub fn new(status_code: StatusCode, headers: HeaderMap<HeaderValue>) -> Self
sourcepub fn get_header_keys(&self) -> Vec<&str>
pub fn get_header_keys(&self) -> Vec<&str>
Returns the list of header keys present in this response.
sourcepub fn get_header_value(&self, key: &str) -> Result<Option<&str>, HeaderError>
pub fn get_header_value(&self, key: &str) -> Result<Option<&str>, HeaderError>
Returns the value of a header.
If the header contains more than one value, only the first value is returned. Refer to
[get_header_values
] for a method that returns all values.
sourcepub fn get_header_values(&self, key: &str) -> Result<Vec<&str>, HeaderError>
pub fn get_header_values(&self, key: &str) -> Result<Vec<&str>, HeaderError>
Returns all values for a header.
If the header contains only one value, it will be returned as a single-element vector.
Refer to [get_header_value
] for a method that returns only a single value.
Trait Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.