pub enum FrcValue {
Show 14 variants
Void,
Boolean(bool),
Int(i64),
Double(f64),
Float(f32),
String(String),
BooleanArray(Vec<bool>),
IntArray(Vec<i64>),
FloatArray(Vec<f32>),
DoubleArray(Vec<f64>),
StringArray(Vec<String>),
Raw(Box<Bytes>),
Struct(&'static str, Box<Bytes>),
Protobuf(&'static FileDescriptorProto, Box<Bytes>),
}
Expand description
A stardized value type for FRC data piping
This enum is used to represent all possible values that can be sent over the FRC data piping system including
- Void
- Boolean
- Int(i64)
- Double
- Float
- String
- BoolArray
- IntArray
- FloatArray
- DoubleArray
- StringArray
- Raw(Bytes)
- Struct
- Protobuf
Struct and Protobuf are special types that carry metadata to allow them to be decoded into their inner types
Bytes are Boxed to keep the size of the enum small
Variants§
Void
Boolean(bool)
Int(i64)
Double(f64)
Float(f32)
String(String)
BooleanArray(Vec<bool>)
IntArray(Vec<i64>)
FloatArray(Vec<f32>)
DoubleArray(Vec<f64>)
StringArray(Vec<String>)
Raw(Box<Bytes>)
Struct(&'static str, Box<Bytes>)
Protobuf(&'static FileDescriptorProto, Box<Bytes>)
Implementations§
Source§impl FrcValue
impl FrcValue
Sourcepub fn get_type(&self) -> FrcType
pub fn get_type(&self) -> FrcType
Returns the type enum of the value, a more memory efficient way of checking the type
Sourcepub fn to_timestamped_now(self) -> FrcTimestampedValue
pub fn to_timestamped_now(self) -> FrcTimestampedValue
Consumes itself to a timestamped value with the current timestamp
Sourcepub fn to_timestamped(self, timestamp: FrcTimestamp) -> FrcTimestampedValue
pub fn to_timestamped(self, timestamp: FrcTimestamp) -> FrcTimestampedValue
Consumes itself to a timestamped value with the given timestamp
Sourcepub fn as_timestamped_now(&self) -> FrcTimestampedValue
pub fn as_timestamped_now(&self) -> FrcTimestampedValue
Clones itself to a timestamped value with the current timestamp
Sourcepub fn as_timestamped(&self, timestamp: FrcTimestamp) -> FrcTimestampedValue
pub fn as_timestamped(&self, timestamp: FrcTimestamp) -> FrcTimestampedValue
Clones itself to a timestamped value with the given timestamp
pub fn to_tagged(self) -> TaggedValue
Sourcepub fn default_value(type: FrcType) -> Option<Self>
pub fn default_value(type: FrcType) -> Option<Self>
Creates a default value based on the type
Types that will return none: - Void - Struct - Protobuf
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FrcValue
impl<'de> Deserialize<'de> for FrcValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Into<FrcValue> for FrcTimestampedValue
impl Into<FrcValue> for FrcTimestampedValue
impl StructuralPartialEq for FrcValue
Auto Trait Implementations§
impl Freeze for FrcValue
impl RefUnwindSafe for FrcValue
impl Send for FrcValue
impl Sync for FrcValue
impl Unpin for FrcValue
impl UnwindSafe for FrcValue
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