Skip to main content

ReprRuleStored

Trait ReprRuleStored 

Source
pub trait ReprRuleStored: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn short_name(&self) -> &'static str;
    fn id(&self) -> ReprId;
    fn applies_to(&self, family: SolverFamily) -> bool;
    fn init_for(
        &self,
        decl: &mut DeclarationPtr,
    ) -> Result<(SymbolTable, Vec<Expression>), ReprError>;
    fn init_for_if_not_exists(
        &self,
        decl: &mut DeclarationPtr,
    ) -> Result<(SymbolTable, Vec<Expression>), ReprError>;
    fn probe_for(&self, decl: &DeclarationPtr) -> Result<usize, ReprError>;
    fn get_or_init_for<'a>(
        &self,
        decl: &'a mut DeclarationPtr,
    ) -> Result<(MappedRwLockReadGuard<'a, RawRwLock, dyn ReprStateStored>, SymbolTable, Vec<Expression>), ReprError>;
    fn get_for<'a>(
        &self,
        decl: &'a DeclarationPtr,
    ) -> Option<MappedRwLockReadGuard<'a, RawRwLock, dyn ReprStateStored>>;
    fn deserialize_state(
        &self,
        val: Value,
    ) -> Result<Box<dyn ReprStateStored>, Error>;
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn short_name(&self) -> &'static str

Source

fn id(&self) -> ReprId

This representation’s identity.

Source

fn applies_to(&self, family: SolverFamily) -> bool

Whether this representation is available when targeting family.

Source

fn init_for( &self, decl: &mut DeclarationPtr, ) -> Result<(SymbolTable, Vec<Expression>), ReprError>

Source

fn init_for_if_not_exists( &self, decl: &mut DeclarationPtr, ) -> Result<(SymbolTable, Vec<Expression>), ReprError>

Source

fn probe_for(&self, decl: &DeclarationPtr) -> Result<usize, ReprError>

Checks applicability without mutating the source declaration and returns its compactness score.

Source

fn get_or_init_for<'a>( &self, decl: &'a mut DeclarationPtr, ) -> Result<(MappedRwLockReadGuard<'a, RawRwLock, dyn ReprStateStored>, SymbolTable, Vec<Expression>), ReprError>

Source

fn get_for<'a>( &self, decl: &'a DeclarationPtr, ) -> Option<MappedRwLockReadGuard<'a, RawRwLock, dyn ReprStateStored>>

Source

fn deserialize_state( &self, val: Value, ) -> Result<Box<dyn ReprStateStored>, Error>

Trait Implementations§

Source§

impl Collect for &'static dyn ReprRuleStored

Source§

impl Debug for dyn ReprRuleStored

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for &'static dyn ReprRuleStored

Source§

fn deserialize<D>( deserializer: D, ) -> Result<&'static dyn ReprRuleStored, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for dyn ReprRuleStored

Source§

impl Hash for dyn ReprRuleStored

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl Ord for dyn ReprRuleStored

Source§

fn cmp(&self, other: &(dyn ReprRuleStored + 'static)) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for dyn ReprRuleStored

Source§

fn eq(&self, other: &(dyn ReprRuleStored + 'static)) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for dyn ReprRuleStored

Source§

fn partial_cmp( &self, other: &(dyn ReprRuleStored + 'static), ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for &'static dyn ReprRuleStored

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> ReprRuleStored for R
where R: ReprRule,