pub struct Client { /* private fields */ }Expand description
Low-level client for interacting with the Toggl API.
Implementations
sourceimpl Client
impl Client
sourcepub fn new(token: String) -> Result<Self, Error>
pub fn new(token: String) -> Result<Self, Error>
Creates a new client with the given API token.
pub fn get_time_entries(
&self,
start_end_dates: Option<(NaiveDate, NaiveDate)>
) -> Result<Vec<TimeEntry>, Error>
pub fn get_current_entry(&self) -> Result<Option<TimeEntry>, Error>
pub fn create_time_entry(&self, entry: NewTimeEntry) -> Result<TimeEntry, Error>
pub fn stop_time_entry(
&self,
workspace_id: &Number,
time_entry_id: &Number
) -> Result<TimeEntry, Error>
pub fn get_projects(&self, workspace_id: &Number) -> Result<Vec<Project>, Error>
pub fn get_workspaces(&self) -> Result<Vec<Workspace>, Error>
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more