pub enum Value {
}Expand description
Owned representation of a libscf value.
Most variants of Value map directly to a libscf type of a similar name;
e.g., Value::Bool(_) maps to scf_type_t::SCF_TYPE_BOOLEAN. For IP
addresses, libscf treats prefixes as optional. This type has separate Ip
and IpNet values of each address family; both the Ip and IpNet for
each family map down to a single libscf type (e.g., Value::NetAddrV4(_)
and Value::NetV4(_) both map to scf_type_t::SCF_TYPE_NET_ADDR_V4.
Variants§
Bool(bool)
Count(u64)
Integer(i64)
Time(DateTime<Utc>)
AString(String)
Opaque(Vec<u8>)
UString(String)
Uri(String)
Fmri(String)
Host(String)
Hostname(String)
NetAddrV4(Ipv4Addr)
NetV4(Ipv4Net)
NetAddrV6(Ipv6Addr)
NetV6(Ipv6Net)
NetAddr(IpAddr)
Net(IpNet)
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_value_ref(&self) -> ValueRef<'_>
pub fn as_value_ref(&self) -> ValueRef<'_>
Convert this value to a borrowed ValueRef.
Sourcepub fn display_smf(&self) -> ValueDisplaySmf<'_>
pub fn display_smf(&self) -> ValueDisplaySmf<'_>
Returns a displayable type that formats values consistently with how SMF
would display them as strings (e.g., Opaque values are hex-encoded;
Time values are {seconds}.{nanoseconds}).
Trait Implementations§
Source§impl Arbitrary for Value
impl Arbitrary for Value
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Value>
type Strategy = BoxedStrategy<Value>
The type of
Strategy used to generate values of type Self.Source§fn arbitrary_with(
args_shared: <Self as Arbitrary>::Parameters,
) -> Self::Strategy
fn arbitrary_with( args_shared: <Self as Arbitrary>::Parameters, ) -> Self::Strategy
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more