Struct libdata::column::Value
[−]
pub struct Value(_);
A column value.
The value represents some bit of information. It is an abstract handle, meaning the concrete type is not known from the outside. It is possible to ask it for its type identity, so it's possible to find out if two values are of the same type or ask if it is of a specific type. It is possible to get access to the typed data (if the type is known and matches), but it should be used only when necessary. Prefer the generic handling when possible.
However, it implements a lot of traits that allow for manipulation in generic manner.
This allows tagging flows with data without knowing the types of information used to tag it upfront.
Note that the values act sane in regards to the normal traits. Eg. the Ord
implementation can
compare even values of different underlying types.
Methods
impl Value
[src]
fn ident(&self) -> Ident
Provides the identity of the column type.
fn downcast_ref<T: 'static>(&self) -> Option<&T>
Tries to turn the value into the type held inside.
This allows accessing the data held inside as the type it actually is. It returns None
if
the requested type doesn't match the actual one.
Generally, you should use this only if you know the type. Most of the handling can be done in a generic way, without extracting the data inside.
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Value
[src]
impl Eq for Value
[src]
impl<C: Type> From<C> for Value
[src]
fn from(c: C) -> Self
Performs the conversion.
impl Ord for Value
[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more
impl PartialEq for Value
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd for Value
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more