pub struct CachedRequest<'client, C: Cache + Send + Sync + 'static, R: RateLimiter + Send + Sync + 'static, Conn: Connect + Clone + Send + Sync + 'static, const AUTHENTICATED: bool, const FORCE: bool> { /* private fields */ }
Trait Implementations§
Source§impl<C: Cache + Send + Sync + 'static, R: RateLimiter + Send + Sync + 'static, Conn: Connect + Clone + Send + Sync + 'static, const AUTHENTICATED: bool, const FORCE: bool> Requester<AUTHENTICATED, FORCE> for CachedRequest<'_, C, R, Conn, AUTHENTICATED, FORCE>
impl<C: Cache + Send + Sync + 'static, R: RateLimiter + Send + Sync + 'static, Conn: Connect + Clone + Send + Sync + 'static, const AUTHENTICATED: bool, const FORCE: bool> Requester<AUTHENTICATED, FORCE> for CachedRequest<'_, C, R, Conn, AUTHENTICATED, FORCE>
type Caching = C
type Connector = Conn
type RateLimiting = R
Source§fn cached(
&self,
cache_duration: Duration,
) -> CachedRequest<'_, Self::Caching, Self::RateLimiting, Self::Connector, AUTHENTICATED, FORCE>
fn cached( &self, cache_duration: Duration, ) -> CachedRequest<'_, Self::Caching, Self::RateLimiting, Self::Connector, AUTHENTICATED, FORCE>
overwrites the cache duration for all requests returned from this
function ## Example Read more
Source§fn forced(
&self,
) -> CachedRequest<'_, Self::Caching, Self::RateLimiting, Self::Connector, AUTHENTICATED, true>
fn forced( &self, ) -> CachedRequest<'_, Self::Caching, Self::RateLimiting, Self::Connector, AUTHENTICATED, true>
forces a fresh copy from the api Read more
Source§fn get<'life0, 'async_trait, T>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<T, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Clone + Send + Sync + FixedEndpoint + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait, T>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<T, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Clone + Send + Sync + FixedEndpoint + 'static,
Self: 'async_trait,
'life0: 'async_trait,
call the fixed endpoint
Source§fn single<'life0, 'async_trait, T, I>(
&'life0 self,
id: impl 'async_trait + Into<I> + Send,
) -> Pin<Box<dyn Future<Output = Result<T, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Clone + Send + Sync + EndpointWithId<IdType = I> + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Send + Sync + Clone + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn single<'life0, 'async_trait, T, I>(
&'life0 self,
id: impl 'async_trait + Into<I> + Send,
) -> Pin<Box<dyn Future<Output = Result<T, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Clone + Send + Sync + EndpointWithId<IdType = I> + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Send + Sync + Clone + 'static,
Self: 'async_trait,
'life0: 'async_trait,
request a single item
Source§fn try_get<'life0, 'life1, 'async_trait, T, I>(
&'life0 self,
id: impl 'async_trait + Into<&'life1 I> + Send,
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
fn try_get<'life0, 'life1, 'async_trait, T, I>( &'life0 self, id: impl 'async_trait + Into<&'life1 I> + Send, ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
retrieves an item from cache Read more
Source§fn ids<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<I>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn ids<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<I>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
request all available ids
Source§fn many<'life0, 'async_trait, T, I>(
&'life0 self,
ids: Vec<impl 'async_trait + Into<I> + Send>,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Clone + Eq + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn many<'life0, 'async_trait, T, I>(
&'life0 self,
ids: Vec<impl 'async_trait + Into<I> + Send>,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Clone + Eq + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
request multiple ids at once
Source§fn page<'life0, 'life1, 'async_trait, T>(
&'life0 self,
page: usize,
page_size: u8,
result: &'life1 mut Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<usize, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + PagedEndpoint + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn page<'life0, 'life1, 'async_trait, T>(
&'life0 self,
page: usize,
page_size: u8,
result: &'life1 mut Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<usize, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + PagedEndpoint + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
requests a page of items and returns the number of total items across
all pages
Source§fn all<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + Eq + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn all<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + Eq + 'static,
Self: 'async_trait,
'life0: 'async_trait,
requests all items using the most efficient method available Read more
Source§fn get_all_by_ids_all<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Clone + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_by_ids_all<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Hash + Clone + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
Gets all items by querying ids=all Read more
Source§fn get_all_by_paging<'life0, 'async_trait, T>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + PagedEndpoint + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_by_paging<'life0, 'async_trait, T>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + PagedEndpoint + Clone + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
Gets all items by querying all pages Read more
Source§fn get_all_by_requesting_ids<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + Eq + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_by_requesting_ids<'life0, 'async_trait, T, I>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, EndpointError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + EndpointWithId<IdType = I> + BulkEndpoint + Clone + Send + Sync + 'static,
I: 'async_trait + Display + DeserializeOwned + Serialize + Hash + Clone + Send + Sync + Eq + 'static,
Self: 'async_trait,
'life0: 'async_trait,
Gets all items by querying all ids Read more
Auto Trait Implementations§
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> Freeze for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> !RefUnwindSafe for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> Send for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> Sync for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> Unpin for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
impl<'client, C, R, Conn, const AUTHENTICATED: bool, const FORCE: bool> !UnwindSafe for CachedRequest<'client, C, R, Conn, AUTHENTICATED, FORCE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more