Struct dot4ch::threadlist::Catalog[][src]

pub struct Catalog { /* fields omitted */ }
Expand description

A summarized list of all threads on a board including thread numbers, their modification time and reply count.

Example

let list1 = Catalog::new(&mut client, "g")?;
println!("{:?}", resp.threads)

to get all threads from catalog

Implementations

impl Catalog[src]

pub async fn new(
    client: &mut Arc<Mutex<Client>>,
    board: &str
) -> Result<Self, Box<dyn Error>>
[src]

Returns a new ThreadList from a given board.

Error

This function will return an error if the board isn’t valid

pub fn update_time(self)[src]

pub fn page(&self, idx: usize) -> Option<&Page>[src]

Returns a reference to the thread depending on argument.

Uses the get() method on Vec.

  • Returns None if the provided index is out of bounds.
  • Returns a single element if a single index is provided.
  • Returns a slice of elements if a range is provided.

Example

let threadlist: ThreadList = /* your threadlist */;
println!("{:?}", thread.get(1..4));

pub fn all_pages(self) -> Vec<Page>[src]

Trait Implementations

impl Debug for Catalog[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Update for Catalog[src]

type Output = Catalog

The type of the output

fn update<'life0, 'async_trait>(
    self,
    client: &'life0 mut Arc<Mutex<Client>>
) -> Pin<Box<dyn Future<Output = Result<Catalog, Box<dyn Error>>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Returns the updated self type.

Auto Trait Implementations

impl RefUnwindSafe for Catalog

impl Send for Catalog

impl Sync for Catalog

impl Unpin for Catalog

impl UnwindSafe for Catalog

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.