pub struct Reader {
declared: Arc<DeclaredLookups>,
foreign: Arc<ForeignRecords>,
registry: Arc<dyn Registry>,
}Expand description
This deployment’s two-phase read of the records its policies declare.
Fields§
§declared: Arc<DeclaredLookups>§foreign: Arc<ForeignRecords>§registry: Arc<dyn Registry>Implementations§
Source§impl Reader
impl Reader
Sourcepub fn new(
declared: Arc<DeclaredLookups>,
foreign: Arc<ForeignRecords>,
registry: Arc<dyn Registry>,
) -> Self
pub fn new( declared: Arc<DeclaredLookups>, foreign: Arc<ForeignRecords>, registry: Arc<dyn Registry>, ) -> Self
A reader over this deployment’s declared lookups, its one foreign record reader, and its registry — which is what says an account is this deployment’s own.
Sourcefn wanted(
&self,
collection: &str,
after: Option<&Value>,
) -> Result<Vec<(Lookup, String, RecordRef)>, LookupRefusal>
fn wanted( &self, collection: &str, after: Option<&Value>, ) -> Result<Vec<(Lookup, String, RecordRef)>, LookupRefusal>
Every record this write’s policies want, each once, or the refusal of a write naming more accounts than they can all be asked about.
An account this deployment holds is not one of them. Its records are this server’s own, the reader refuses to fetch them over the network, and spending a write’s lookup budget on a refusal it can predict would leave less of it for the strangers the rule is about.
Sourcepub async fn prefetch(&self, collection: &str, after: Option<&Value>)
pub async fn prefetch(&self, collection: &str, after: Option<&Value>)
Fills the cache with what this write’s policies want and it does not
already hold. Bounded by didbot-lookup’s own deadlines and by how
many records one write may read. A write the write path will refuse
for naming too many accounts reads nothing.
Trait Implementations§
Source§impl WriteLookups for Reader
impl WriteLookups for Reader
Source§fn answers(
&self,
_account: &str,
collection: &str,
after: Option<&Value>,
) -> Result<Vec<OwnedLookup>, LookupRefusal>
fn answers( &self, _account: &str, collection: &str, after: Option<&Value>, ) -> Result<Vec<OwnedLookup>, LookupRefusal>
account is the repository being written
to, collection what is being written, and after the record the
write leaves, which is where the accounts it names are read from.Auto Trait Implementations§
impl Freeze for Reader
impl !RefUnwindSafe for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
impl !UnwindSafe for Reader
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