Trait mz_sql::session::vars::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<'a> PartialEq for &'a dyn Value

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for Box<dyn Value>

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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

source§

impl Eq for Box<dyn Value>

Implementations on Foreign Types§

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 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 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 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 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 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 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 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 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 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 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 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 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<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§