[][src]Struct hackgt_nfc::api::CheckinAPI

pub struct CheckinAPI { /* fields omitted */ }

Methods

impl CheckinAPI[src]

An implementation of the HackGT Check-In API

pub fn login(username: &str, password: &str, url: &str) -> Result<Self, Error>[src]

Log into the API using a username / password combination provided to you

Note: this will block for a few seconds because the server has a high PBKDF2 iteration count by default

pub fn from_token(auth_token: String, url: &str) -> Self[src]

Create an API instance directly from an auth token

Can be used to instantly resume an API instance after having obtained a token previously

pub fn auth_token(&self) -> &str[src]

pub fn add_user(&self, username: &str, password: &str) -> Result<(), Error>[src]

Creates a new user with the provided username / password combination

Can be used to provision sub-devices like with checkin-embedded

pub fn delete_user(&self, username: &str) -> Result<(), Error>[src]

pub fn check_in(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>[src]

Check a user into a tag

Returns a three item tuple containing:

  • Check in success (true / false)
  • User information
  • Tag information (for the tag specified)

pub fn check_out(&self, uuid: &str, tag: &str) -> Result<CheckInReturn, Error>[src]

Check a user out of tag

See documentation for check_in for more details

pub fn get_tags_names(&self, only_current: bool) -> Result<Vec<String>, Error>[src]

Get a list of tag names from the check-in instance

Can optionally be filtered to only include tags that are currently active (computed from start / end attributes in check-in database)

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.