[][src]Struct nanowrimo::client::NanoClient

pub struct NanoClient { /* fields omitted */ }

A client with which to connect to the Nano site. Can be used with or without login.

Implementations

impl NanoClient[src]

pub fn new_anon() -> NanoClient[src]

Create a new client with the 'anonymous' or 'guest' user, not logged in

pub async fn new_user<'_, '_>(
    user: &'_ str,
    pass: &'_ str
) -> Result<NanoClient, Error>
[src]

Create a new client that is automatically logged in as a specific user

pub fn is_logged_in(&self) -> bool[src]

Check whether this client is currently logged in

pub async fn login<'_>(&'_ self) -> Result<(), Error>[src]

Log in this client, without logging out

pub async fn logout<'_>(&'_ self) -> Result<(), Error>[src]

Log out this client, without checking if it's logged in

pub async fn change_user<'_, '_, '_>(
    &'_ mut self,
    user: Option<&'_ str>,
    pass: Option<&'_ str>
) -> Result<(), Error>
[src]

Change the current user of the client. Logs out if necessary, and either logs in if provided with username/password, or stays logged out and shifts to the 'guest' user

pub async fn fundometer<'_>(&'_ self) -> Result<Fundometer, Error>[src]

Get information about the Nano fundometer

pub async fn search<'_, '_>(
    &'_ self,
    name: &'_ str
) -> Result<CollectionResponse<UserObject>, Error>
[src]

Search for users by username

pub async fn random_offer<'_>(
    &'_ self
) -> Result<ItemResponse<PostObject>, Error>
[src]

Get a random sponsor offer

pub async fn store_items<'_>(&'_ self) -> Result<Vec<StoreItem>, Error>[src]

Get a list of all store items

pub async fn offers<'_>(
    &'_ self
) -> Result<Vec<ItemResponse<PostObject>>, Error>
[src]

Get a list of all current sponsor offers

pub async fn current_user_include<'_, '_>(
    &'_ self,
    include: &'_ [NanoKind]
) -> Result<ItemResponse<UserObject>, Error>
[src]

Get the currently logged in user, with included linked items

pub async fn current_user<'_>(
    &'_ self
) -> Result<ItemResponse<UserObject>, Error>
[src]

Get the currently logged in user

pub async fn pages<'_, '_>(
    &'_ self,
    page: &'_ str
) -> Result<ItemResponse<PageObject>, Error>
[src]

Get info about a specific set of pages. Known valid values include:

  • "what-is-camp-nanowrimo"
  • "nano-prep-101"
  • "pep-talks"
  • "dei"
  • "come-write-in"
  • "about-nano"
  • "staff"
  • "board-of-directors"
  • "writers-board"
  • "terms-and-conditions"
  • "writers-board"
  • "brought-to-you-by"

If you know of other valid values, please open an issue with the values to add to this list!

pub async fn notifications<'_>(
    &'_ self
) -> Result<CollectionResponse<NotificationObject>, Error>
[src]

Get the list of notifications for the current user

pub async fn available_challenges<'_>(
    &'_ self
) -> Result<CollectionResponse<ChallengeObject>, Error>
[src]

Get a set of all the challenges this user has access to (Possibly all they can make projects in)

pub async fn get_all_include_filtered<'_, '_, '_, '_>(
    &'_ self,
    ty: NanoKind,
    include: &'_ [NanoKind],
    filter: &'_ [(&'_ str, u64)]
) -> Result<CollectionResponse, Error>
[src]

Get all accessible items of a specific kind, with included linked items and filtering to certain related IDs.

'includes' will add more items in the response as part of an 'includes' list, so one request can get more items

'filter' will filter certain types of objects by IDs of other objects related to them.

Warning: Many filter combinations are invalid, and the rules are not currently fully understood.

pub async fn get_all_filtered<'_, '_, '_>(
    &'_ self,
    ty: NanoKind,
    filter: &'_ [(&'_ str, u64)]
) -> Result<CollectionResponse, Error>
[src]

Get all accessible items of a specific kind, with filtering to certain related IDs (See Self::get_all_include_filtered)

pub async fn get_all_include<'_, '_>(
    &'_ self,
    ty: NanoKind,
    include: &'_ [NanoKind]
) -> Result<CollectionResponse, Error>
[src]

Get all accessible items of a specific kind, with included linked items (See Self::get_all_include_filtered)

pub async fn get_all<'_>(
    &'_ self,
    ty: NanoKind
) -> Result<CollectionResponse, Error>
[src]

Get all accessible items of a specific kind, neither filtering nor including linked items (See Self::get_all_include_filtered)

pub async fn get_id_include<'_, '_>(
    &'_ self,
    ty: NanoKind,
    id: u64,
    include: &'_ [NanoKind]
) -> Result<ItemResponse, Error>
[src]

Get an item of a specific type and ID, with included linked items

pub async fn get_id<'_>(
    &'_ self,
    ty: NanoKind,
    id: u64
) -> Result<ItemResponse, Error>
[src]

Get an item of a specific type and ID, with no included items. (See Self::get_id_include)

Get all items from a given RelationLink, a tie from one object to object(s) of a specific type that are related to it.

Warning: Not all RelationLinks can be retrieved, some will return a 404 due to the way Nano handle them on its end, if you know ahead of time that you will need the relations, it's better to use Self::get_id_include or Self::get_all_include

Get a single item from a given RelationLink, a tie from one object to object(s) of a specific type that are related to it. Single relations tend to not have the same pitfalls as multiple relations, so this is less dangerous than Self::get_all_related

Trait Implementations

impl Debug for NanoClient[src]

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> Instrument for T[src]

impl<T> Instrument 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.