pub enum TypedData {
Null,
Bool(bool),
Int32(i32),
UInt32(u32),
Int64(i64),
UInt64(u64),
IPv4(Ipv4Addr),
IPv6(Ipv6Addr),
String(String),
Binary(Vec<u8>),
}Variants§
Null
Bool(bool)
Int32(i32)
UInt32(u32)
Int64(i64)
UInt64(u64)
IPv4(Ipv4Addr)
IPv6(Ipv6Addr)
String(String)
Binary(Vec<u8>)
Implementations§
Trait Implementations§
Source§impl From<Option<&str>> for TypedData
impl From<Option<&str>> for TypedData
Source§fn from(value: Option<&str>) -> Self
fn from(value: Option<&str>) -> Self
Converts a Option<&str> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::String.
Source§impl From<Option<Ipv4Addr>> for TypedData
impl From<Option<Ipv4Addr>> for TypedData
Source§fn from(value: Option<Ipv4Addr>) -> Self
fn from(value: Option<Ipv4Addr>) -> Self
Converts a Option<Ipv4Addr> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::IPv4(value).
Source§impl From<Option<Ipv6Addr>> for TypedData
impl From<Option<Ipv6Addr>> for TypedData
Source§fn from(value: Option<Ipv6Addr>) -> Self
fn from(value: Option<Ipv6Addr>) -> Self
Converts a Option<Ipv6Addr> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::IPv6(value).
Source§impl From<Option<String>> for TypedData
impl From<Option<String>> for TypedData
Source§fn from(value: Option<String>) -> Self
fn from(value: Option<String>) -> Self
Converts a Option<String> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::String(value).
Source§impl From<Option<Vec<u8>>> for TypedData
impl From<Option<Vec<u8>>> for TypedData
Source§fn from(value: Option<Vec<u8>>) -> Self
fn from(value: Option<Vec<u8>>) -> Self
Converts a Option<Vec<u8>> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::Binary(value).
Source§impl From<Option<bool>> for TypedData
impl From<Option<bool>> for TypedData
Source§fn from(value: Option<bool>) -> Self
fn from(value: Option<bool>) -> Self
Converts a Option<bool> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::Bool(value).
Source§impl From<Option<i32>> for TypedData
impl From<Option<i32>> for TypedData
Source§fn from(value: Option<i32>) -> Self
fn from(value: Option<i32>) -> Self
Converts a Option<i32> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::Int32(value).
Source§impl From<Option<i64>> for TypedData
impl From<Option<i64>> for TypedData
Source§fn from(value: Option<i64>) -> Self
fn from(value: Option<i64>) -> Self
Converts a Option<i64> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::Int64(value).
Source§impl From<Option<u32>> for TypedData
impl From<Option<u32>> for TypedData
Source§fn from(value: Option<u32>) -> Self
fn from(value: Option<u32>) -> Self
Converts a Option<u32> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::UInt32(value).
Source§impl From<Option<u64>> for TypedData
impl From<Option<u64>> for TypedData
Source§fn from(value: Option<u64>) -> Self
fn from(value: Option<u64>) -> Self
Converts a Option<u64> into TypedData. If the value is None, it returns TypedData::Null. If the value is Some(value), it returns TypedData::UInt64(value).
Source§impl TryFrom<TypedData> for Option<Ipv4Addr>
impl TryFrom<TypedData> for Option<Ipv4Addr>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<Ipv4Addr> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::IPv4 it returns Some(Ipv4Addr).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<Ipv6Addr>
impl TryFrom<TypedData> for Option<Ipv6Addr>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<Ipv6Addr> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::IPv6 it returns Some(Ipv6Addr).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<String>
impl TryFrom<TypedData> for Option<String>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<String> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::String it returns Some(String).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<Vec<u8>>
impl TryFrom<TypedData> for Option<Vec<u8>>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<Vec<u8>> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::Binary it returns Some(Vec<u8>).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<bool>
impl TryFrom<TypedData> for Option<bool>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<bool> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::Bool it returns Some(bool).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<i32>
impl TryFrom<TypedData> for Option<i32>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<i32> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::Int32 it returns Some(i32).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<i64>
impl TryFrom<TypedData> for Option<i64>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<i64> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::Int64 it returns Some(i64).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<u32>
impl TryFrom<TypedData> for Option<u32>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<u32> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::UInt32 it returns Some(u32).
Source§type Error = TypedDataError
type Error = TypedDataError
Source§impl TryFrom<TypedData> for Option<u64>
impl TryFrom<TypedData> for Option<u64>
Source§fn try_from(value: TypedData) -> Result<Self, Self::Error>
fn try_from(value: TypedData) -> Result<Self, Self::Error>
Converts a TypedData to an Option<u64> failing if the type conversion is invalid.
If the value is TypedData::Null, it returns None.
If the value is TypedData::UInt64 it returns Some(u64).