Enum Pmt Copy item path Source #[non_exhaustive]
pub enum Pmt {
Show 19 variants Ok,
InvalidValue,
Null,
String(String ),
Bool(bool ),
Usize(usize ),
Isize(isize ),
U32(u32 ),
U64(u64 ),
F32(f32 ),
F64(f64 ),
VecCF32(Vec <Complex <f32 >>),
VecF32(Vec <f32 >),
VecU64(Vec <u64 >),
Blob(Vec <u8 >),
VecPmt(Vec <Pmt >),
Finished,
MapStrPmt(HashMap <String , Pmt >),
Any(Box <dyn PmtAny>),
}Expand description Polymorphic message type used by FutureSDR message ports.
PMTs are the input and output values for message handlers and runtime
control calls. Most variants serialize normally; Pmt::Any is skipped
during serialization and is intended only for in-process values.
String parsing accepts a few short forms such as Ok, Null, true, and
false, plus serde-compatible enum JSON such as { "U32": 123 } and the
compact U32: 123 syntax used by simple UIs.
use futuresdr_types::{Pmt, PmtKind};
let pmt = Pmt::Usize(7 );
assert_eq! (pmt.kind(), PmtKind::Usize);
assert_eq! (usize::try_from(pmt)? , 7 );This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Successful operation without additional payload.
Invalid value.
Mainly used as the return type in message handlers when the parameter is
outside the allowed range.
Absence of a value.
Used, for example, as the input type, when the message handler is mainly about the return
type.
Native-sized unsigned integer.
Native-sized signed integer.
Vector of 32-bit complex floats.
Vector of 64-bit unsigned integers.
Runtime message used to signal that a connected block finished.
Map from string keys to PMT values.
Type-erased in-process payload.
Wrap anything that implements Any in a Pmt. Use
downcast_ref/mut() to extract.
Get the PMT variant kind without associated data.
Create a Pmt by parsing a string into a specific PmtKind .
Only scalar kinds that have a straightforward textual representation are
supported here. Use std::str::FromStr for full PMT JSON parsing.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The associated error which can be returned from parsing.
Parses a string
s to return a value of this type.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Serialize this value into the given Serde serializer.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Converts to this type from a reference to the input type.
Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.