pub struct Attribute {
pub tag: BString,
pub attribute_type: char,
pub value: BString,
}Expand description
Represents an optional attribute in a graph
Attributes consist of three components:
tag- Identifier for the attribute (e.g., “name”, “weight”)attribute_type- Single character identifying the data type:- ‘i’: Integer
- ‘f’: Float
- ‘Z’: String (default)
- ‘J’: JSON
- ‘H’: Hexadecimal
- ‘B’: Binary bytes
value- The actual value stored as a BString
Attributes are typically formatted as “tag:type:value” when serialized.
Fields§
§tag: BString§attribute_type: char§value: BStringImplementations§
Source§impl Attribute
impl Attribute
Sourcepub fn builder() -> AttributeBuilder
pub fn builder() -> AttributeBuilder
Create an instance of Attribute using the builder syntax
Source§impl Attribute
impl Attribute
Sourcepub fn typed_value(&self) -> Result<AttributeValue>
pub fn typed_value(&self) -> Result<AttributeValue>
Get the attribute value as the appropriate type based on the attribute type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Attribute
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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