pub struct Thread { /* private fields */ }
Expand description
The main end user interface to the 4chan thread API.
Contains data about a chan thread.
Implementations
sourceimpl Thread
impl Thread
sourcepub async fn new(
client: &Arc<Mutex<Client>>,
board: &str,
post_id: u32
) -> Result<Self, DotError>
pub async fn new(
client: &Arc<Mutex<Client>>,
board: &str,
post_id: u32
) -> Result<Self, DotError>
sourcepub fn find(&self, id: u32) -> Option<&Post>
pub fn find(&self, id: u32) -> Option<&Post>
Find an post with an ID
Returns the first element of
sourcepub fn update_time(&mut self)
pub fn update_time(&mut self)
Updates the time when the last GET was performed
sourcepub fn last_reply(&self) -> Option<u32>
pub fn last_reply(&self) -> Option<u32>
Return the ID of the last reply
sourcepub fn replies_no(&self) -> usize
pub fn replies_no(&self) -> usize
Return the number of replies
sourcepub fn thread_url(&self) -> String
pub fn thread_url(&self) -> String
Return the API URL of a thread.
sourcepub fn into_board(self) -> Board
pub fn into_board(self) -> Board
Trait Implementations
sourceimpl IfModifiedSince for Thread
impl IfModifiedSince for Thread
sourcefn fetch<'life0, 'life1, 'life2, 'async_trait>(
client: &'life0 Arc<Mutex<Client>>,
url: &'life1 str,
header: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<Response, DotError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch<'life0, 'life1, 'life2, 'async_trait>(
client: &'life0 Arc<Mutex<Client>>,
url: &'life1 str,
header: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<Response, DotError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetches the given URL with an If-Modifed-Since
header.
sourceimpl<Idx> Index<Idx> for Thread where
Idx: SliceIndex<[Post]>,
impl<Idx> Index<Idx> for Thread where
Idx: SliceIndex<[Post]>,
sourceimpl Procedures for Thread
impl Procedures for Thread
sourcefn fetch_status<'async_trait>(
self,
response: Response
) -> Pin<Box<dyn Future<Output = Result<Self::Output, DotError>> + 'async_trait>> where
Self: 'async_trait,
fn fetch_status<'async_trait>(
self,
response: Response
) -> Pin<Box<dyn Future<Output = Result<Self::Output, DotError>> + 'async_trait>> where
Self: 'async_trait,
Checks the status of a Response
and generates a new thread if needed.
Auto Trait Implementations
impl !RefUnwindSafe for Thread
impl Send for Thread
impl Sync for Thread
impl Unpin for Thread
impl !UnwindSafe for Thread
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more