pub enum AttributeValues {
Numeric(Vec<f64>),
Boolean(Vec<bool>),
String(Vec<String>),
}Expand description
The values of an attribute for several vertices or edges.
Converts from Vec<f64>, Vec<bool>, Vec<String>, Vec<&str> and the
corresponding slices, so that Graph::set_vertex_attr_values accepts
them directly.
Variants§
Numeric(Vec<f64>)
Numeric values.
Boolean(Vec<bool>)
Boolean values.
String(Vec<String>)
String values.
Implementations§
Source§impl AttributeValues
impl AttributeValues
Sourcepub fn attribute_type(&self) -> AttributeType
pub fn attribute_type(&self) -> AttributeType
The AttributeType of the values.
Sourcepub fn get(&self, index: usize) -> Option<AttributeValue>
pub fn get(&self, index: usize) -> Option<AttributeValue>
The value at index, if any.
Sourcepub fn as_numeric(&self) -> Option<&[f64]>
pub fn as_numeric(&self) -> Option<&[f64]>
The numbers, if these are numeric values.
Sourcepub fn as_strings(&self) -> Option<&[String]>
pub fn as_strings(&self) -> Option<&[String]>
The strings, if these are string values.
Trait Implementations§
Source§impl Clone for AttributeValues
impl Clone for AttributeValues
Source§fn clone(&self) -> AttributeValues
fn clone(&self) -> AttributeValues
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AttributeValues
impl Debug for AttributeValues
Source§impl From<&[&str]> for AttributeValues
impl From<&[&str]> for AttributeValues
Source§impl From<&[bool]> for AttributeValues
impl From<&[bool]> for AttributeValues
Source§impl From<&[f64]> for AttributeValues
impl From<&[f64]> for AttributeValues
Source§impl PartialEq for AttributeValues
impl PartialEq for AttributeValues
Source§fn eq(&self, other: &AttributeValues) -> bool
fn eq(&self, other: &AttributeValues) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AttributeValues
Auto Trait Implementations§
impl Freeze for AttributeValues
impl RefUnwindSafe for AttributeValues
impl Send for AttributeValues
impl Sync for AttributeValues
impl Unpin for AttributeValues
impl UnsafeUnpin for AttributeValues
impl UnwindSafe for AttributeValues
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