Struct GenericNetwork

Source
pub struct GenericNetwork<V> { /* private fields */ }
Expand description

A plan or projection of entity-attribute-value sets with constraints between them.

Implementations§

Source§

impl<V> GenericNetwork<V>

Source

pub fn add_triples(&mut self) -> Triples

Adds one group of entity-attribute-value triples that can be constrained with values or by fields on other triples groups.

Source

pub fn constrain(&mut self, c: Constraint<V>)

Adds a Constraint.

Source

pub fn add_constraint(&mut self, c: Constraint<V>)

Adds a Constraint.

Source

pub fn triples(&self) -> usize

The number of triples added into this network.

Source

pub fn constraints(&self) -> &[Constraint<V>]

Source

pub fn constraints_mut(&mut self) -> &mut [Constraint<V>]

Source

pub fn fluent_triples(&mut self) -> FluentTriples<'_, V>

Source§

impl<V> GenericNetwork<V>
where V: TypeTag + ToSql,

Source

pub fn prefetch_attributes(&mut self, woof: &DontWoof<'_>) -> Result<()>

Source§

impl<V> GenericNetwork<V>
where V: PartialEq,

Shorthand for iter::once(field).chain(network.links_to(field)).

All TriplesField with equality constraints to the given TriplesField.

Source

pub fn constraints_on( &self, on: TriplesField, ) -> impl Iterator<Item = &Constraint<V>> + '_

Source

pub fn is_linked( &self, a: TriplesField, b: TriplesField, ) -> Option<&Constraint<V>>

Find an equality constraint between these two fields.

Source

pub fn is_matched<I: Into<V>>( &self, a: TriplesField, v: I, ) -> Option<&Constraint<V>>

Find an equality constraint between a field and a value.

Source

pub fn constraint_value_matches( &self, v: V, ) -> impl Iterator<Item = TriplesField> + '_

Source

pub fn value_for_entity_attribute<A>( &mut self, entity: TriplesField, attribute: A, ) -> TriplesField
where A: AsRef<AttributeRef> + Clone, V: From<A>,

Find or add triples t such that t.e = field and t.a = attribute.

Source§

impl<'n, V> GenericNetwork<V>

Source

pub fn select(&'n self) -> Select<'n, V>

Trait Implementations§

Source§

impl<V: Clone> Clone for GenericNetwork<V>

Source§

fn clone(&self) -> GenericNetwork<V>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug> Debug for GenericNetwork<V>

Source§

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

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

impl<V> Default for GenericNetwork<V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'n, V> From<&'n GenericNetwork<V>> for Select<'n, V>

Source§

fn from(network: &'n GenericNetwork<V>) -> Self

Converts to this type from the input type.
Source§

impl<V: PartialEq> PartialEq for GenericNetwork<V>

Source§

fn eq(&self, other: &GenericNetwork<V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V> StructuralPartialEq for GenericNetwork<V>

Auto Trait Implementations§

§

impl<V> Freeze for GenericNetwork<V>

§

impl<V> RefUnwindSafe for GenericNetwork<V>
where V: RefUnwindSafe,

§

impl<V> Send for GenericNetwork<V>
where V: Send,

§

impl<V> Sync for GenericNetwork<V>
where V: Sync,

§

impl<V> Unpin for GenericNetwork<V>
where V: Unpin,

§

impl<V> UnwindSafe for GenericNetwork<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.