Struct napchart::api::AsyncClient[][src]

pub struct AsyncClient { /* fields omitted */ }

Asynchronous api client for https://napchart.com

Implementations

impl AsyncClient[src]

pub async fn get<'a, T: Into<&'a str>>(
    &self,
    chartid: T
) -> Result<Napchart, ErrorKind>
[src]

Asynchronously downloads the napchart with the given id from napchart.com

Uses the https://thumb.napchart.com/api/get endpoint

pub async fn create(&self, chart: &Napchart) -> Result<String, ErrorKind>[src]

Asynchronously creates a napchart on napchart.com and returns its id

Uses the https://thumb.napchart.com/alt/api/create endpoint

pub async fn create_new(&self, chart: &mut Napchart) -> Result<(), ErrorKind>[src]

Asynchronously creates a napchart on napchart.com and sets the chartid of the napchart struct to the assigned id

Uses the https://thumb.napchart.com/alt/api/create endpoint

pub async fn get_image<'a, T: Into<&'a str>>(
    &self,
    chartid: T,
    dest: &mut File,
    size: (u32, u32),
    shape: Option<ChartShape>
) -> Result<(), ErrorKind>
[src]

Asynchronously downloads an image representation of a napchart from napchart.com and saves it to the given &mut File

Uses the https://thumb.napchart.com/api/getImage endpoint

Trait Implementations

impl Default for AsyncClient[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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

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.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,