pub struct BusId(pub usize);Expand description
A bus identifier as it appears in the source file: the external, stable id
(1-based in MATPOWER, and possibly sparse — pegase has gaps in its ids).
Distinct from the dense [0, n) analysis index, which only
IndexedNetwork produces, via
bus_index. The two are both integers
and trivially confused; making the id its own type stops one being used where
the other is meant (using a 1-based id to index a matrix is off-by-one on a
contiguous case and pure garbage on a sparse one).
#[serde(transparent)] so the JSON transport carries a bare integer, not a
wrapper object — the wire format is unchanged.
Tuple Fields§
§0: usizeTrait Implementations§
Source§impl<'de> Deserialize<'de> for BusId
impl<'de> Deserialize<'de> for BusId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BusId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BusId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for BusId
impl Ord for BusId
Source§impl PartialOrd for BusId
impl PartialOrd for BusId
Source§impl Serialize for BusId
impl Serialize for BusId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BusId
impl Eq for BusId
impl StructuralPartialEq for BusId
Auto Trait Implementations§
impl Freeze for BusId
impl RefUnwindSafe for BusId
impl Send for BusId
impl Sync for BusId
impl Unpin for BusId
impl UnsafeUnpin for BusId
impl UnwindSafe for BusId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more