Struct typedb_driver::concept::Attribute
source · pub struct Attribute {
pub iid: IID,
pub type_: AttributeType,
pub value: Value,
pub is_inferred: bool,
}
Expand description
Attribute is an instance of the attribute type and has a value. This value is fixed and unique for every given instance of the attribute type. Attributes can be uniquely addressed by their type and value.
Fields§
§iid: IID
The unique id of this Attribute
type_: AttributeType
The type which this Attribute belongs to
value: Value
The value which this Attribute instance holds.
is_inferred: bool
If this Attribute is inferred by a [Reasoning Rule] or not
Trait Implementations§
source§impl AttributeAPI for Attribute
impl AttributeAPI for Attribute
source§impl PartialEq for Attribute
impl PartialEq for Attribute
source§impl ThingAPI for Attribute
impl ThingAPI for Attribute
source§fn is_inferred(&self) -> bool
fn is_inferred(&self) -> bool
Checks if this
Thing
is inferred by a [Reasoning Rule]. Read morefn to_thing_cloned(&self) -> Thing
source§fn is_deleted<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> BoxPromise<'tx, Result<bool>>
fn is_deleted<'tx>( &self, transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result<bool>>
Checks if this
Thing
is deleted. Read moresource§fn delete<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> BoxPromise<'tx, Result>
fn delete<'tx>( &self, transaction: &'tx Transaction<'_> ) -> BoxPromise<'tx, Result>
Deletes this
Thing
. Read moresource§fn get_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute_types: Vec<AttributeType>,
annotations: Vec<Annotation>
) -> Result<BoxStream<'tx, Result<Attribute>>>
fn get_has<'tx>( &self, transaction: &'tx Transaction<'_>, attribute_types: Vec<AttributeType>, annotations: Vec<Annotation> ) -> Result<BoxStream<'tx, Result<Attribute>>>
Retrieves the
Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s. Read moresource§fn set_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute: Attribute
) -> BoxPromise<'tx, Result>
fn set_has<'tx>( &self, transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result>
source§fn unset_has<'tx>(
&self,
transaction: &'tx Transaction<'_>,
attribute: Attribute
) -> BoxPromise<'tx, Result>
fn unset_has<'tx>( &self, transaction: &'tx Transaction<'_>, attribute: Attribute ) -> BoxPromise<'tx, Result>
source§fn get_relations<'tx>(
&self,
transaction: &'tx Transaction<'_>,
role_types: Vec<RoleType>
) -> Result<BoxStream<'tx, Result<Relation>>>
fn get_relations<'tx>( &self, transaction: &'tx Transaction<'_>, role_types: Vec<RoleType> ) -> Result<BoxStream<'tx, Result<Relation>>>
Retrieves all the
Relations
which this Thing
plays a role in, optionally filtered by one or more given roles. Read moresource§fn get_playing<'tx>(
&self,
transaction: &'tx Transaction<'_>
) -> Result<BoxStream<'tx, Result<RoleType>>>
fn get_playing<'tx>( &self, transaction: &'tx Transaction<'_> ) -> Result<BoxStream<'tx, Result<RoleType>>>
Retrieves the roles that this
Thing
is currently playing. Read moreimpl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request