Skip to main content

Value

Trait Value 

Source
pub trait Value:
    Any
    + AsAny
    + Debug
    + Send
    + Sync {
    // Required methods
    fn type_name() -> Cow<'static, str>
       where Self: Sized;
    fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
       where Self: Sized;
    fn format(&self) -> String;
    fn box_clone(&self) -> Box<dyn Value>;

    // Provided method
    fn parse_dyn_value(
        input: VarInput<'_>,
    ) -> Result<Box<dyn Value>, VarParseError>
       where Self: Sized { ... }
}
Expand description

Defines a value that get stored as part of a System or Session variable.

This trait is partially object safe, see VarDefinition for more details.

Required Methods§

Source

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source

fn format(&self) -> String

Source

fn box_clone(&self) -> Box<dyn Value>

Provided Methods§

Source

fn parse_dyn_value(input: VarInput<'_>) -> Result<Box<dyn Value>, VarParseError>
where Self: Sized,

Parse an instance of Self from VarInput, returning it as a Box<dyn Value>.

Trait Implementations§

Source§

impl Eq for Box<dyn Value>

Source§

impl<'a> Eq for &'a dyn Value

Source§

impl PartialEq for Box<dyn Value>

Source§

fn eq(&self, other: &Box<dyn Value>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> PartialEq for &'a dyn Value

Source§

fn eq(&self, other: &&dyn Value) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Value for ByteSize

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for CloneableEnvFilter

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for CompactionStyle

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for CompressionType

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Cow<'static, str>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Duration

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for NonZeroU32

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Numeric

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Option<CheckedTimestamp<DateTime<Utc>>>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for String

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Timestamp

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Value

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Vec<Ident>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Vec<IpNet>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for Vec<SerializableDirective>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for bool

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for f64

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for i32

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for u32

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for u64

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl Value for usize

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Source§

impl<V: Value + Clone> Value for Option<V>

Source§

fn type_name() -> Cow<'static, str>
where Self: Sized,

Source§

fn parse(input: VarInput<'_>) -> Result<Self, VarParseError>
where Self: Sized,

Source§

fn box_clone(&self) -> Box<dyn Value>

Source§

fn format(&self) -> String

Implementors§