Service

Struct Service 

Source
pub struct Service { /* private fields */ }
Expand description

Service is an abstraction over google tasks.

Implementations§

Source§

impl Service

Source

pub fn with_auth<P>(token_provider: P) -> Result<Self, TasksError>
where P: TokenProvider,

Creates a new service with the given token provider.

Source

pub fn with_token(access_token: &str) -> Result<Self, TasksError>

Creates a new service with the given access token.

Source

pub fn new(access_token: &str) -> Result<Self, TasksError>

👎Deprecated since 0.5.0: Please use Service::with_token instead

Creates a new service with the given access token.

Source

pub async fn list_tasklists( &self, opt: Option<TasklistsOptions>, ) -> Result<Tasklists, TasksError>

Returns all the authenticated user’s task lists.

Source

pub async fn get_tasklist(&self, id: &str) -> Result<Tasklist, TasksError>

Returns the authenticated user’s specified task list.

Source

pub async fn insert_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>

Creates a new task list and adds it to the authenticated user’s task lists.

Source

pub async fn update_tasklist(&self, v: Tasklist) -> Result<Tasklist, TasksError>

Updates the authenticated user’s specified task list.

Source

pub async fn delete_tasklist(&self, id: &str) -> Result<(), TasksError>

Deletes the authenticated user’s specified task list.

Source

pub async fn patch_tasklist( &self, tasklist_id: &str, v: Tasklist, ) -> Result<Tasklist, TasksError>

Updates the authenticated user’s specified task list. This method supports patch semantics.

Source

pub async fn list_tasks( &self, tasklist_id: &str, opt: Option<TaskOptions>, etag: Option<String>, ) -> Result<Option<Tasks>, TasksError>

Returns all tasks in the specified task list.

Source

pub async fn get_task( &self, tasklist_id: &str, task_id: &str, etag: Option<String>, ) -> Result<Option<Task>, TasksError>

Returns the specified task.

Source

pub async fn insert_task( &self, tasklist_id: &str, v: Task, opts: Option<TaskInsertOptions>, ) -> Result<Task, TasksError>

Creates a new task on the specified task list.

Source

pub async fn update_task( &self, tasklist_id: &str, v: Task, ) -> Result<Task, TasksError>

Updates the specified task.

Source

pub async fn delete_task( &self, tasklist_id: &str, task_id: &str, ) -> Result<(), TasksError>

Deletes the specified task from the task list.

Source

pub async fn clear_tasks(&self, tasklist_id: &str) -> Result<(), TasksError>

Clears all completed tasks from the specified task list. The affected tasks will be marked as ‘hidden’ and no longer be returned by default when retrieving all tasks for a task list.

Source

pub async fn move_task( &self, tasklist_id: &str, task_id: &str, opts: TaskInsertOptions, ) -> Result<Task, TasksError>

Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.

Source

pub async fn patch_task( &self, tasklist_id: &str, task_id: &str, v: Task, ) -> Result<Task, TasksError>

Updates the specified task. This method supports patch semantics.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more