pub struct FactBinding { /* private fields */ }Expand description
Mapping from one gatekeep fact to one keepsake relation.
Implementations§
Source§impl FactBinding
impl FactBinding
Sourcepub const fn new(fact: FactId, relation_id: RelationId) -> Self
pub const fn new(fact: FactId, relation_id: RelationId) -> Self
Builds a binding that resolves in both decision and query mode.
Sourcepub const fn with_query_presence(
fact: FactId,
relation_id: RelationId,
query_presence: QueryPresence,
) -> Self
pub const fn with_query_presence( fact: FactId, relation_id: RelationId, query_presence: QueryPresence, ) -> Self
Builds a binding with explicit query-mode behavior.
Sourcepub const fn on_subject(
fact: FactId,
relation_id: RelationId,
subject_slot: SubjectSlot,
) -> Self
pub const fn on_subject( fact: FactId, relation_id: RelationId, subject_slot: SubjectSlot, ) -> Self
Builds a binding for a request-scoped subject slot.
Sourcepub const fn with_subject_and_query_presence(
fact: FactId,
relation_id: RelationId,
subject_slot: Option<SubjectSlot>,
query_presence: QueryPresence,
) -> Self
pub const fn with_subject_and_query_presence( fact: FactId, relation_id: RelationId, subject_slot: Option<SubjectSlot>, query_presence: QueryPresence, ) -> Self
Builds a binding for a request-scoped subject slot with explicit query-mode behavior.
Sourcepub fn for_relation_spec<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn for_relation_spec<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn for_relation_spec_on_subject<F, R>(
subject_slot: SubjectSlot,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn for_relation_spec_on_subject<F, R>(
subject_slot: SubjectSlot,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation on a request-scoped subject.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn resolve_relation<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn resolve_relation<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation that is resolved during query preparation.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn defer_relation<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn defer_relation<F, R>() -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation that is left unknown during query preparation for row-level lowering.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn for_relation_spec_with_query_presence<F, R>(
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn for_relation_spec_with_query_presence<F, R>(
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation, with explicit query-mode behavior.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub fn for_relation_spec_on_subject_with_query_presence<F, R>(
subject_slot: SubjectSlot,
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
pub fn for_relation_spec_on_subject_with_query_presence<F, R>(
subject_slot: SubjectSlot,
query_presence: QueryPresence,
) -> Result<Self, FactBindingError>where
F: Fact,
R: RelationSpec,
Binds a typed gatekeep fact to a typed keepsake relation on a request-scoped subject, with explicit query-mode behavior.
§Errors
Returns FactBindingError::Gatekeep if the fact marker exposes an
invalid stable id.
Sourcepub const fn relation_id(&self) -> RelationId
pub const fn relation_id(&self) -> RelationId
Returns the keepsake relation id.
Sourcepub const fn subject_slot(&self) -> Option<&SubjectSlot>
pub const fn subject_slot(&self) -> Option<&SubjectSlot>
Returns the request-scoped subject slot for this binding.
Sourcepub const fn query_presence(&self) -> QueryPresence
pub const fn query_presence(&self) -> QueryPresence
Returns query-mode resolution behavior.
Trait Implementations§
Source§impl Clone for FactBinding
impl Clone for FactBinding
Source§fn clone(&self) -> FactBinding
fn clone(&self) -> FactBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more