[][src]Struct nextcloud_analytics_rs::SyncClient

pub struct SyncClient { /* fields omitted */ }

A synchronous client to call the Nextcloud Analytics API.

Implementations

impl SyncClient[src]

pub fn new<S: Into<String>>(
    nextcloud_url: &str,
    collection: u32,
    user: S,
    passwd: S
) -> Self
[src]

Create a new synchronous client to call the Nextcloud Analytics API.

  • nextcloud_url is the base URL of the Nextcloud instance.
  • collection is the collection index, as presented by Nextcloud Analytics' interface (number in the URL).
  • user is the Nextcloud user's name.
  • passwd is an app password associaetd to the Nextcloud user's account.

pub fn send_data<S: Into<String>, F: Into<f64>>(
    &self,
    dimension1: S,
    dimension2: S,
    dimension3: F
) -> Result<(), Box<dyn Error>>
[src]

Sends some data to the API, the two first dimensions must be formatted as text while the last dimension must be a numerical value.

For timeline data, dimension2 must be the date in the RFC2822 format.

pub fn send_timeline_data<S: Into<String>, F: Into<f64>>(
    &self,
    key: S,
    time: DateTime<Utc>,
    value: F
) -> Result<(), Box<dyn Error>>
[src]

Sends some timeline data to the API: the key is the index of this piece of data, associated to the given value at the given time. for the given time.

pub fn send_timeline_now_data<S: Into<String>, F: Into<f64>>(
    &self,
    key: S,
    value: F
) -> Result<(), Box<dyn Error>>
[src]

Sends some timeline data to the API: the key is the index of this piece of data, associated to the given value at the current UTC time.

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