[−][src]Struct brokaw::raw::RawResponse
A response returned by the low-level NntpConnection
- The contents are guaranteed to be represent a syntactically valid NNTP response
- The contents ARE NOT guaranteed to be UTF-8 as the NNTP does not require contents be UTF-8.
Implementations
impl RawResponse
[src]
pub fn code(&self) -> ResponseCode
[src]
The response code
pub fn has_data_blocks(&self) -> bool
[src]
Return true if this response is a multi-line response and contains a data block section
pub fn data_blocks(&self) -> Option<&DataBlocks>
[src]
Return multi-line data blocks
pub fn first_line(&self) -> &[u8]
[src]
Return the first line of the response
pub fn first_line_without_code(&self) -> &[u8]
[src]
Return the first line of the response without the response code
pub fn fail_unless(
self,
desired: impl Into<ResponseCode>
) -> Result<RawResponse, Error>
[src]
self,
desired: impl Into<ResponseCode>
) -> Result<RawResponse, Error>
Converts a response into an error if it does not match the provided status
pub fn first_line_to_utf8_lossy(&self) -> Cow<str>
[src]
Lossily convert the first line to UTF-8
pub unsafe fn first_line_as_utf8_unchecked(&self) -> &str
[src]
Convert the initial response payload into UTF-8 without checking
Safety
This function is unsafe because NNTP responses are NOT required to be UTF-8.
This call simply calls from_utf8_unchecked
under the hood.
Trait Implementations
impl Clone for RawResponse
[src]
fn clone(&self) -> RawResponse
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RawResponse
[src]
impl<'_> TryFrom<&'_ RawResponse> for Body
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(resp: &RawResponse) -> Result<Self>
[src]
impl<'_> TryFrom<&'_ RawResponse> for BinaryArticle
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(resp: &RawResponse) -> Result<Self>
[src]
Convert a raw response into an article
For the specification see RFC 3977 sections:
impl<'_> TryFrom<&'_ RawResponse> for Head
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(resp: &RawResponse) -> Result<Self>
[src]
impl<'_> TryFrom<&'_ RawResponse> for Stat
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(resp: &RawResponse) -> Result<Self>
[src]
impl<'_> TryFrom<&'_ RawResponse> for Capabilities
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(resp: &RawResponse) -> Result<Self>
[src]
Parse capabilities from a response
The specific format is taken from RFC 3977
impl<'_> TryFrom<&'_ RawResponse> for Group
[src]
Auto Trait Implementations
impl RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnwindSafe for RawResponse
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,