pub enum ModelPayload {
Balanced {
balanced_network: Box<BalancedNetwork>,
},
Multiconductor {
multiconductor_network: Box<MulticonductorNetwork>,
},
}Expand description
The one IR payload a package carries, tagged by kind in JSON so the payload
is self-describing in addition to the top-level model_kind.
The payload is the serde snapshot of the PowerIO Rust IR
(powerio::Network / [powerio_dist::DistNetwork]), declared by the
package’s payload_schema / payload_schema_version fields and versioned
independently of the envelope: additive IR growth bumps the payload minor
with no envelope version change. See docs/src/pio-json-schema.md.
Variants§
Implementations§
Source§impl ModelPayload
impl ModelPayload
pub fn balanced(net: BalancedNetwork) -> Self
pub fn multiconductor(net: MulticonductorNetwork) -> Self
pub fn kind(&self) -> ModelKind
Sourcepub fn as_balanced(&self) -> Option<&BalancedNetwork>
pub fn as_balanced(&self) -> Option<&BalancedNetwork>
The balanced payload, if this is one.
Sourcepub fn as_multiconductor(&self) -> Option<&MulticonductorNetwork>
pub fn as_multiconductor(&self) -> Option<&MulticonductorNetwork>
The multiconductor payload, if this is one.
Trait Implementations§
Source§impl Clone for ModelPayload
impl Clone for ModelPayload
Source§fn clone(&self) -> ModelPayload
fn clone(&self) -> ModelPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelPayload
impl Debug for ModelPayload
Source§impl<'de> Deserialize<'de> for ModelPayload
impl<'de> Deserialize<'de> for ModelPayload
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
Auto Trait Implementations§
impl Freeze for ModelPayload
impl RefUnwindSafe for ModelPayload
impl Send for ModelPayload
impl Sync for ModelPayload
impl Unpin for ModelPayload
impl UnsafeUnpin for ModelPayload
impl UnwindSafe for ModelPayload
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