pub struct PermissionSets {
resolver: Arc<dyn Resolve>,
cache: Mutex<LruCache<String, Entry>>,
}Expand description
Every set this deployment has resolved, shared by every account.
Fields§
§resolver: Arc<dyn Resolve>§cache: Mutex<LruCache<String, Entry>>Implementations§
Source§impl PermissionSets
impl PermissionSets
Sourcepub fn over_network(doh: impl Into<String>, private: PrivateAddresses) -> Self
pub fn over_network(doh: impl Into<String>, private: PrivateAddresses) -> Self
Sets resolved over the network; see Network::new.
Sourcepub async fn expand(&self, requested: &ScopeSet) -> ScopeSet
pub async fn expand(&self, requested: &ScopeSet) -> ScopeSet
requested with each include: replaced by the atoms its set
grants.
An include: grants nothing when it names no set, when its set does
not resolve, and when its atoms would take the request past what one
grant may hold (MAX_GRANT_ATOMS, MAX_GRANT_BYTES). Every
other atom is kept as it was asked for.
Sourceasync fn include(
&self,
nsid: &str,
aud: Option<&str>,
started: Instant,
sets: &mut usize,
) -> Result<Vec<Scope>, String>
async fn include( &self, nsid: &str, aud: Option<&str>, started: Instant, sets: &mut usize, ) -> Result<Vec<Scope>, String>
What one include: grants, or why it grants nothing.
Sourceasync fn permissions(
&self,
nsid: &str,
budget: Duration,
) -> Result<Arc<Vec<Value>>, Unresolved>
async fn permissions( &self, nsid: &str, budget: Duration, ) -> Result<Arc<Vec<Value>>, Unresolved>
The published permissions of the set nsid names, from the cache
or resolved within budget.
Sourcefn cached(
&self,
nsid: &str,
now: Instant,
) -> Option<Result<Arc<Vec<Value>>, Unresolved>>
fn cached( &self, nsid: &str, now: Instant, ) -> Option<Result<Arc<Vec<Value>>, Unresolved>>
The cache’s answer for nsid at now, if it has one that needs no
resolution: a copy still fresh, or a failure too recent to retry.
Sourcefn remember(
&self,
nsid: &str,
resolved: Result<Vec<Value>, Unresolved>,
) -> Result<Arc<Vec<Value>>, Unresolved>
fn remember( &self, nsid: &str, resolved: Result<Vec<Value>, Unresolved>, ) -> Result<Arc<Vec<Value>>, Unresolved>
Stores what resolving nsid just established, and answers with what
a sign-in should use: the new copy, or the last one while the
authority cannot be reached and the copy is kept.
fn lock(&self) -> MutexGuard<'_, LruCache<String, Entry>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PermissionSets
impl !RefUnwindSafe for PermissionSets
impl Send for PermissionSets
impl Sync for PermissionSets
impl Unpin for PermissionSets
impl UnsafeUnpin for PermissionSets
impl !UnwindSafe for PermissionSets
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more