Trait libdata::column::Type
[−]
pub trait Type where
Self: Clone + Debug + for<'de> Deserialize<'de> + Ord + Serialize + Sized + 'static, {
fn name() -> String;
}
A trait for the types that can be made into the generic Value
Implementing this trait allows a type to act as the generic opaque Value
. This mostly means
providing some other common traits, but also assigning a name for the tag, which is used for
serializing and deserializing the tag's identity.
Note that there can be only one tag of each type. Therefore, if a flow needs to be tagged with
something that is eg. a String
, create a newtype for that.
Some data are relevant for the local and remote endpoints. There are the
Local
and Remote
wrappers for that and an
EndpointType
trait.
Note that for some actions to be usable for a type, the type needs to be registered in
addition to implementing this trait. See register
.
Required Methods
fn name() -> String
A name of the tag.
The name is used when serializing to JSON. It must be unique between all registered types.
Implementors
impl<I: EndpointType> Type for Local<I>
impl<I: EndpointType> Type for Remote<I>
impl Type for IpProto
impl Type for IpProtoRaw
impl Type for Direction