pub struct Entities { /* private fields */ }Expand description
Represents an entity hierarchy, and allows looking up Entity objects by
UID.
Note that Entities is Serialize and Deserialize, but currently this is
only used for the Dafny-FFI layer in DRT. All others use (and should use) the
from_json_*() and write_to_json() methods as necessary.
Implementations§
Source§impl Entities
impl Entities
Sourcepub fn partial(self) -> Self
pub fn partial(self) -> Self
Transform the store into a partial store, where attempting to dereference a non-existent EntityUID results in a residual instead of an error.
Sourcepub fn entity(&self, uid: &EntityUID) -> Dereference<'_, Entity>
pub fn entity(&self, uid: &EntityUID) -> Dereference<'_, Entity>
Get the Entity with the given UID, if any
Sourcepub fn from_entities(
entities: impl IntoIterator<Item = Entity>,
tc_computation: TCComputation,
) -> Result<Self>
pub fn from_entities( entities: impl IntoIterator<Item = Entity>, tc_computation: TCComputation, ) -> Result<Self>
Create an Entities object with the given entities.
If you pass TCComputation::AssumeAlreadyComputed, then the caller is
responsible for ensuring that TC and DAG hold before calling this method.
Sourcepub fn to_json_value(&self) -> Result<Value>
pub fn to_json_value(&self) -> Result<Value>
Convert an Entities object into a JSON value suitable for parsing in
via EntityJsonParser.
The returned JSON value will be parse-able even with no Schema.
To parse an Entities object from a JSON value, use EntityJsonParser.
Sourcepub fn write_to_json(&self, f: impl Write) -> Result<()>
pub fn write_to_json(&self, f: impl Write) -> Result<()>
Dump an Entities object into an entities JSON file.
The resulting JSON will be suitable for parsing in via
EntityJsonParser, and will be parse-able even with no Schema.
To read an Entities object from an entities JSON file, use
EntityJsonParser.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entities
impl<'de> Deserialize<'de> for Entities
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Entities
impl StructuralPartialEq for Entities
Auto Trait Implementations§
impl Freeze for Entities
impl RefUnwindSafe for Entities
impl Send for Entities
impl Sync for Entities
impl Unpin for Entities
impl UnwindSafe for Entities
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more