[−][src]Struct brokaw::types::TextArticle
A text Netnews article returned by the ARTICLE
command
Unlike BinaryArticle
a TextArticle
MUST have a UTF-8 body.
The following methods can be used to create a TextArticle
from a BinaryArticle
:
from_binary
is fallible as it performs UTF-8 checksfrom_binary_lossy
is infallible but will replace non UTF-8 characters with placeholders. Please seeString::from_utf8_lossy
for more info.
Implementations
impl TextArticle
[src]
pub fn number(&self) -> ArticleNumber
[src]
The number of the article relative to the group it was retrieved from
pub fn message_id(&self) -> &str
[src]
The message id of the article
pub fn headers(&self) -> &Headers
[src]
The headers on the article
pub fn body(&self) -> &[String]
[src]
Return the body of the article
pub fn from_binary(b: &BinaryArticle) -> Result<Self>
[src]
Create a text article from a
pub fn from_binary_lossy(b: &BinaryArticle) -> Self
[src]
Create a text article from a binary one, replacing invalid UTF-8 characters with placeholders
pub fn lines(&self) -> Lines
[src]
An iterator over the lines in the body of the article
Each line will not include the CRLF terminator
Trait Implementations
impl Clone for TextArticle
[src]
fn clone(&self) -> TextArticle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TextArticle
[src]
impl Eq for TextArticle
[src]
impl PartialEq<TextArticle> for TextArticle
[src]
fn eq(&self, other: &TextArticle) -> bool
[src]
fn ne(&self, other: &TextArticle) -> bool
[src]
impl StructuralEq for TextArticle
[src]
impl StructuralPartialEq for TextArticle
[src]
Auto Trait Implementations
impl RefUnwindSafe for TextArticle
impl Send for TextArticle
impl Sync for TextArticle
impl Unpin for TextArticle
impl UnwindSafe for TextArticle
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>,