[][src]Struct ucare::group::Service

pub struct Service<'a> { /* fields omitted */ }

Service is used to make calls to group API.

Implementations

impl<'_> Service<'_>[src]

pub fn info(&self, group_id: &str) -> Result<Info>[src]

Acquires some file specific info

pub fn list(&self, params: ListParams) -> Result<List>[src]

Returns a list of groups

This example is not tested

let params = group::ListParams{
    limit: Some(10),
    ordering: Some(group::Ordering::CreatedAtDesc),
    from: None,
};
let list = group_svc.list(params)?;
let mut next_page = list.next;

let mut groups = list.results.unwrap();
while let Some(next) = next_page {
    let new_page = group_svc.get_page(&next).unwrap();
    next_page = new_page.next;
    groups.extend(new_page.results.unwrap());
}

for group in groups.iter() {
    println!("group: {}", group);
}

pub fn get_page(&self, url: &str) -> Result<List>[src]

Gets next page by its url

pub fn store(&self, group_id: &str) -> Result<Info>[src]

Marks all files in group as stored

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Service<'a>

impl<'a> !Send for Service<'a>

impl<'a> !Sync for Service<'a>

impl<'a> Unpin for Service<'a>

impl<'a> !UnwindSafe for Service<'a>

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 = 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.