[−][src]Struct nanowrimo::client::NanoClient
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]
user: &'_ str,
pass: &'_ str
) -> Result<NanoClient, Error>
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]
&'_ mut self,
user: Option<&'_ str>,
pass: Option<&'_ str>
) -> Result<(), Error>
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]
&'_ self,
name: &'_ str
) -> Result<CollectionResponse<UserObject>, Error>
Search for users by username
pub async fn random_offer<'_>(
&'_ self
) -> Result<ItemResponse<PostObject>, Error>
[src]
&'_ self
) -> Result<ItemResponse<PostObject>, Error>
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]
&'_ self
) -> Result<Vec<ItemResponse<PostObject>>, Error>
Get a list of all current sponsor offers
pub async fn current_user_include<'_, '_>(
&'_ self,
include: &'_ [NanoKind]
) -> Result<ItemResponse<UserObject>, Error>
[src]
&'_ self,
include: &'_ [NanoKind]
) -> Result<ItemResponse<UserObject>, Error>
Get the currently logged in user, with included linked items
pub async fn current_user<'_>(
&'_ self
) -> Result<ItemResponse<UserObject>, Error>
[src]
&'_ self
) -> Result<ItemResponse<UserObject>, Error>
Get the currently logged in user
pub async fn pages<'_, '_>(
&'_ self,
page: &'_ str
) -> Result<ItemResponse<PageObject>, Error>
[src]
&'_ self,
page: &'_ str
) -> Result<ItemResponse<PageObject>, Error>
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]
&'_ self
) -> Result<CollectionResponse<NotificationObject>, Error>
Get the list of notifications for the current user
pub async fn available_challenges<'_>(
&'_ self
) -> Result<CollectionResponse<ChallengeObject>, Error>
[src]
&'_ self
) -> Result<CollectionResponse<ChallengeObject>, Error>
Get a set of all the challenges this user has access to (Possibly all they can make projects in)
pub async fn daily_aggregates<'_>(
&'_ self,
id: u64
) -> Result<CollectionResponse<DailyAggregateObject>, Error>
[src]
&'_ self,
id: u64
) -> Result<CollectionResponse<DailyAggregateObject>, Error>
Get the daily aggregates for a given ProjectChallenge ProjectChallenge is the common link between a project and a challenge it was part of, thus providing info for counts on given days
pub async fn get_all_include_filtered<'_, '_, '_, '_>(
&'_ self,
ty: NanoKind,
include: &'_ [NanoKind],
filter: &'_ [(&'_ str, u64)]
) -> Result<CollectionResponse, Error>
[src]
&'_ self,
ty: NanoKind,
include: &'_ [NanoKind],
filter: &'_ [(&'_ str, u64)]
) -> Result<CollectionResponse, Error>
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]
&'_ self,
ty: NanoKind,
filter: &'_ [(&'_ str, u64)]
) -> Result<CollectionResponse, Error>
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]
&'_ self,
ty: NanoKind,
include: &'_ [NanoKind]
) -> Result<CollectionResponse, Error>
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]
&'_ self,
ty: NanoKind
) -> Result<CollectionResponse, Error>
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]
&'_ self,
ty: NanoKind,
id: u64,
include: &'_ [NanoKind]
) -> Result<ItemResponse, Error>
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]
&'_ self,
ty: NanoKind,
id: u64
) -> Result<ItemResponse, Error>
Get an item of a specific type and ID, with no included items.
(See Self::get_id_include
)
pub async fn get_slug_include<'_, '_, '_>(
&'_ self,
ty: NanoKind,
slug: &'_ str,
include: &'_ [NanoKind]
) -> Result<ItemResponse, Error>
[src]
&'_ self,
ty: NanoKind,
slug: &'_ str,
include: &'_ [NanoKind]
) -> Result<ItemResponse, Error>
Get an item of a specific type and slug, with included items. A slug is a unique text identifier for an object, not all types have one.
pub async fn get_slug<'_, '_>(
&'_ self,
ty: NanoKind,
slug: &'_ str
) -> Result<ItemResponse, Error>
[src]
&'_ self,
ty: NanoKind,
slug: &'_ str
) -> Result<ItemResponse, Error>
Get an item of a specific type and slug, with no included items. A slug is a unique text identifier for an object, not all types have one.
pub async fn get_all_related<'_, '_>(
&'_ self,
rel: &'_ RelationLink
) -> Result<CollectionResponse, Error>
[src]
&'_ self,
rel: &'_ RelationLink
) -> Result<CollectionResponse, Error>
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
pub async fn get_unique_related<'_, '_>(
&'_ self,
rel: &'_ RelationLink
) -> Result<ItemResponse, Error>
[src]
&'_ self,
rel: &'_ RelationLink
) -> Result<ItemResponse, Error>
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
Auto Trait Implementations
impl !RefUnwindSafe for NanoClient
impl Send for NanoClient
impl !Sync for NanoClient
impl Unpin for NanoClient
impl !UnwindSafe for NanoClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,