Datapath

Trait Datapath 

Source
pub trait Datapath
where Self: Send + Sync + 'static + Clone + Sized + Eq + PartialEq + Hash + Debug + Display,
{ type Tuple; type WildcardableTuple; const PATTERN: &'static str; // Required methods fn from_tuple(tuple: Self::Tuple) -> Self; fn to_tuple(self) -> Self::Tuple; fn from_wildcardable(tuple: Self::WildcardableTuple) -> String; fn with_file(&self, file: impl Into<String>) -> DatapathFile<Self>; fn parse(path: &str) -> Option<DatapathFile<Self>>; fn field(&self, name: &str) -> Option<String>; }

Required Associated Constants§

Source

const PATTERN: &'static str

The exact pattern string passed to the macro that generated this struct

Required Associated Types§

Source

type Tuple

A tuple of this path’s parameter types, in the order they appear in the pattern

Source

type WildcardableTuple

Datapath::Tuple, but each type is wrapped in a crate::Wildcardable.

Required Methods§

Source

fn from_tuple(tuple: Self::Tuple) -> Self

Source

fn to_tuple(self) -> Self::Tuple

Source

fn from_wildcardable(tuple: Self::WildcardableTuple) -> String

Return a string where wildcarded partitions are *.

Source

fn with_file(&self, file: impl Into<String>) -> DatapathFile<Self>

Returns a DatapathFile with the given file at this datapath

Source

fn parse(path: &str) -> Option<DatapathFile<Self>>

Parse a string as this datapath with a (possibly empty-string) file, returning None if this string is invalid.

Source

fn field(&self, name: &str) -> Option<String>

Get the string value of the field with the given name, if it exists.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§