pub enum BandwidthControllerRequest {
EcashTicket(ReturnSender<Option<PreparedCredential>>, EcashTicketRequest),
UpgradeModeToken(ReturnSender<Option<String>>),
AttemptRevertSpending(ReturnSender<bool>, PreparedCredentialMetadata),
SetCredentialFetcher(ReturnSender<()>, Option<Arc<dyn CredentialFetcher>>),
SetPublicDataFetcher(ReturnSender<()>, Option<Arc<dyn CredentialPublicDataFetcher>>),
Reset(ReturnSender<()>),
ClearEmergencyCredentials(ReturnSender<()>),
GetAvailableTicketbooks(ReturnSender<AvailableTicketbooks>),
RestockTicketbooks(ReturnSender<()>, Vec<TicketType>),
WaitForTicketbooks(ReturnSender<()>, Vec<TicketType>),
}Variants§
EcashTicket(ReturnSender<Option<PreparedCredential>>, EcashTicketRequest)
UpgradeModeToken(ReturnSender<Option<String>>)
AttemptRevertSpending(ReturnSender<bool>, PreparedCredentialMetadata)
SetCredentialFetcher(ReturnSender<()>, Option<Arc<dyn CredentialFetcher>>)
Sets (or clears, with None) the credential fetcher; a new one triggers an immediate restock.
SetPublicDataFetcher(ReturnSender<()>, Option<Arc<dyn CredentialPublicDataFetcher>>)
Sets (or clears, with None) the global-data fetcher.
Reset(ReturnSender<()>)
Cancels in-flight fetches, drops the fetcher, clears all stored credentials, and fails every parked readiness waiter.
ClearEmergencyCredentials(ReturnSender<()>)
Removes the stored emergency (upgrade-mode) credentials only, leaving ticketbooks intact.
GetAvailableTicketbooks(ReturnSender<AvailableTicketbooks>)
Returns the currently stored ticketbooks (also logs a stock summary).
RestockTicketbooks(ReturnSender<()>, Vec<TicketType>)
Checks the given ticket types and kicks off a background restock for any running low or about to expire. Resolves once the check has been scheduled, not once the fetches finish.
Not to be used lightly: the automatic triggers (ticket handout, timer, fetcher install) already keep every type stocked. This is a manual safety valve, not a routine call.
WaitForTicketbooks(ReturnSender<()>, Vec<TicketType>)
Resolves once every required ticket type is usable (stocked or covered by upgrade mode), or fails if a required type is neither stocked nor being fetched.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BandwidthControllerRequest
impl !UnwindSafe for BandwidthControllerRequest
impl Freeze for BandwidthControllerRequest
impl Send for BandwidthControllerRequest
impl Sync for BandwidthControllerRequest
impl Unpin for BandwidthControllerRequest
impl UnsafeUnpin for BandwidthControllerRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Deprecatable for T
impl<T> Deprecatable for T
fn deprecate(self) -> Deprecated<Self>where
Self: Sized,
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>
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>
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 moreSource§impl<T> OptionalSet for T
impl<T> OptionalSet for T
Source§fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
Some), the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_validated_optional<F, T, V, E>(
self,
f: F,
value: Option<T>,
validate: V,
) -> Result<Self, E>
fn with_validated_optional<F, T, V, E>( self, f: F, value: Option<T>, validate: V, ) -> Result<Self, E>
Some) it is validated and then the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the FromStr implementation and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.Source§fn with_optional_custom_env<F, T, G>(
self,
f: F,
val: Option<T>,
env_var: &str,
parser: G,
) -> Self
fn with_optional_custom_env<F, T, G>( self, f: F, val: Option<T>, env_var: &str, parser: G, ) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the provided parser and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.