pub struct KeepsakeResolver<S, M = TenantScopedSubjectMapper> { /* private fields */ }Expand description
Resolves gatekeep facts from active keepsake relations for the principal.
Implementations§
Source§impl<S> KeepsakeResolver<S, TenantScopedSubjectMapper>
impl<S> KeepsakeResolver<S, TenantScopedSubjectMapper>
Source§impl<S, M> KeepsakeResolver<S, M>
impl<S, M> KeepsakeResolver<S, M>
Sourcepub const fn with_subject_mapper(source: S, subject_mapper: M) -> Self
pub const fn with_subject_mapper(source: S, subject_mapper: M) -> Self
Builds a resolver with an explicit subject mapper.
Sourcepub fn map_subjects<Next>(
self,
subject_mapper: Next,
) -> KeepsakeResolver<S, Next>
pub fn map_subjects<Next>( self, subject_mapper: Next, ) -> KeepsakeResolver<S, Next>
Replaces the subject mapper.
Sourcepub fn with_binding(self, binding: FactBinding) -> Self
pub fn with_binding(self, binding: FactBinding) -> Self
Adds or replaces a fact binding.
Sourcepub fn insert_binding(&mut self, binding: FactBinding)
pub fn insert_binding(&mut self, binding: FactBinding)
Adds or replaces a fact binding.
Sourcepub fn with_relation_spec<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn with_relation_spec<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Adds or replaces a typed fact-to-relation binding.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn with_resolved_relation<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn with_resolved_relation<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Adds or replaces a typed binding that is resolved during query preparation.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn with_deferred_relation<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn with_deferred_relation<F, R>(self) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Adds or replaces a typed binding that is deferred during query preparation for row-level lowering.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn with_relation_spec_query_presence<F, R>(
self,
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn with_relation_spec_query_presence<F, R>(
self,
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Adds or replaces a typed binding with explicit query-mode behavior.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn with_relation_spec_on_subject<F, R>(
self,
subject_slot: SubjectSlot,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn with_relation_spec_on_subject<F, R>(
self,
subject_slot: SubjectSlot,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Adds or replaces a typed binding resolved against a request-scoped subject slot.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub const fn bindings(&self) -> &BTreeMap<FactId, FactBinding>
pub const fn bindings(&self) -> &BTreeMap<FactId, FactBinding>
Returns the configured bindings keyed by fact id.
Sourcepub const fn subject_mapper(&self) -> &M
pub const fn subject_mapper(&self) -> &M
Returns the subject mapper.
Trait Implementations§
Source§impl<S: Clone, M: Clone> Clone for KeepsakeResolver<S, M>
impl<S: Clone, M: Clone> Clone for KeepsakeResolver<S, M>
Source§fn clone(&self) -> KeepsakeResolver<S, M>
fn clone(&self) -> KeepsakeResolver<S, M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more