Struct StatePredicate
#[non_exhaustive]pub struct StatePredicate { /* private fields */ }Expand description
A block or tag filter, with unspecified properties left as wildcards. An unknown or missing property on a tag member never matches.
Implementations§
§impl StatePredicate
impl StatePredicate
pub fn block(
metadata: &dyn BlockMetadata,
block: BlockKey,
constraints: &[StateConstraint],
) -> Result<StatePredicate, BlockStateError>
pub fn block( metadata: &dyn BlockMetadata, block: BlockKey, constraints: &[StateConstraint], ) -> Result<StatePredicate, BlockStateError>
A block filter; unknown properties, illegal values and duplicate properties refuse. A partial filter need not produce the default state’s complete combination.
pub fn tag(
metadata: &dyn BlockMetadata,
_tags: &dyn Tags,
tag: TagKey,
constraints: &[StateConstraint],
) -> Result<StatePredicate, BlockStateError>
pub fn tag( metadata: &dyn BlockMetadata, _tags: &dyn Tags, tag: TagKey, constraints: &[StateConstraint], ) -> Result<StatePredicate, BlockStateError>
A tag filter; duplicate properties refuse, but arbitrary properties and empty tags remain valid. Membership is evaluated against authoritative tags at application, not frozen here.
pub fn block_key(&self) -> Option<BlockKey>
pub fn block_key(&self) -> Option<BlockKey>
The exact block this predicate selects, if it is not a tag filter.
pub fn tag_key(&self) -> Option<TagKey>
pub fn tag_key(&self) -> Option<TagKey>
The tag this predicate selects, if it is not an exact block filter.
pub fn constraints(&self) -> &[StateConstraint]
pub fn constraints(&self) -> &[StateConstraint]
Explicit property requirements; all must match, but omitted properties are unrestricted.
Trait Implementations§
§impl Clone for StatePredicate
impl Clone for StatePredicate
§fn clone(&self) -> StatePredicate
fn clone(&self) -> StatePredicate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for StatePredicate
impl Debug for StatePredicate
§impl PartialEq for StatePredicate
impl PartialEq for StatePredicate
impl StructuralPartialEq for StatePredicate
Auto Trait Implementations§
impl Freeze for StatePredicate
impl RefUnwindSafe for StatePredicate
impl Send for StatePredicate
impl Sync for StatePredicate
impl Unpin for StatePredicate
impl UnsafeUnpin for StatePredicate
impl UnwindSafe for StatePredicate
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
Mutably borrows from an owned value. Read more