pub struct Fetch<T, F> { /* private fields */ }Expand description
A fetch that is not sent yet: await it to read the cache first and ask Discord when the
cache does not hold the value (D-230), or call force first to always ask
Discord.
A cache hit allocates nothing; the REST request is only made (and boxed) when needed.
discord.js counterpart: the fetch(id, { force }) methods of the managers.
Implementations§
Trait Implementations§
Source§impl<T: Unpin, F: Future<Output = Result<T, Error>>> IntoFuture for Fetch<T, F>
impl<T: Unpin, F: Future<Output = Result<T, Error>>> IntoFuture for Fetch<T, F>
Source§type IntoFuture = FetchFuture<T, F>
type IntoFuture = FetchFuture<T, F>
Which kind of future are we turning this into?
Source§fn into_future(self) -> FetchFuture<T, F> ⓘ
fn into_future(self) -> FetchFuture<T, F> ⓘ
Creates a future from a value. Read more
Auto Trait Implementations§
impl<T, F> Freeze for Fetch<T, F>
impl<T, F> RefUnwindSafe for Fetch<T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for Fetch<T, F>
impl<T, F> Sync for Fetch<T, F>
impl<T, F> Unpin for Fetch<T, F>
impl<T, F> UnsafeUnpin for Fetch<T, F>where
F: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, F> UnwindSafe for Fetch<T, F>where
F: UnwindSafe,
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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