[][src]Struct anitable::Anitable

pub struct Anitable { /* fields omitted */ }

애니편성표 API Wrapper

Example

use anitable::*;

#[tokio::main]
async fn main() -> Result<(), failure::Error> {
    let client = Anitable::new();
    let data = client.list(Tabletype::Sun).await?; // 일요일
    println!("{:?}", data); // 애니목록 출력

    let data = client.cap(data[0].id).await?; // 애니목록 0번째 자막
    println!("{:?}", data); // 자막목록 출력
    Ok(())
}

Methods

impl Anitable[src]

pub fn new_with_host(host: &str) -> Self[src]

테스트를 위한 생성자

Example

 let client = Anitable::new_with_host(&mockito::server_url());

pub fn new() -> Self[src]

일반 생성자

Example

 let client = Anitable::new();

pub async fn list<'_>(
    &'_ self,
    tabletype: Tabletype
) -> Result<Vec<AnimeData>, Error>
[src]

해당하는 타입의 애니메이션 편성목록을 리턴.

Arguments

  • tabletype - 편성표 구분

Example

let animations = client.list(Tabletype::Sun).await?;

pub async fn cap<'_>(&'_ self, anime_id: i32) -> Result<Vec<CaptionData>, Error>[src]

입력받은 애니메이션의 자막 목록을 리턴.

Arguments

  • anime_id - 애니메이션의 고유번호

Example

let captions = client.cap(anime.id).await?;

Auto Trait Implementations

impl !RefUnwindSafe for Anitable

impl Send for Anitable

impl Sync for Anitable

impl Unpin for Anitable

impl !UnwindSafe for Anitable

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

type Error = !

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.