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 a direct serde snapshot of the live PowerIO Rust IR
(powerio::Network / powerio_dist::DistNetwork). It is experimental: it
grows whenever the IR does, with no envelope version change. Only the envelope
is versioned. See docs/src/pio-json-schema.md.
Variants§
Balanced
Fields
§
balanced_network: Box<BalancedNetwork>Multiconductor
Fields
§
multiconductor_network: Box<MulticonductorNetwork>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 (const: unstable) · 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