Enum dfir_lang::graph::PortIndexValue  
source · pub enum PortIndexValue {
    Int(IndexInt),
    Path(ExprPath),
    Elided(Option<Span>),
}Expand description
Helper struct for PortIndex which keeps span information for elided ports.
Variants§
Int(IndexInt)
An integer value: [0], [1], etc. Can be negative although we don’t use that (2023-08-16).
Path(ExprPath)
A name or path. [pos], [neg], etc. Can use :: separators but we don’t use that (2023-08-16).
Elided(Option<Span>)
Elided, unspecified port. We have this variant, rather than wrapping in Option, in order
to preserve the Span information.
Implementations§
source§impl PortIndexValue
 
impl PortIndexValue
sourcepub fn from_ported<Inner>(ported: Ported<Inner>) -> (Self, Inner, Self)where
    Inner: Spanned,
 
pub fn from_ported<Inner>(ported: Ported<Inner>) -> (Self, Inner, Self)where
    Inner: Spanned,
For a Ported value like [port_in]name[port_out], get the port_in and port_out as
PortIndexValues.
sourcepub fn is_specified(&self) -> bool
 
pub fn is_specified(&self) -> bool
Returns true if self is not PortIndexValue::Elided.
sourcepub fn combine(self, other: Self) -> Result<Self, Self>
 
pub fn combine(self, other: Self) -> Result<Self, Self>
Return Err(self) if there is a conflict.
sourcepub fn as_error_message_string(&self) -> String
 
pub fn as_error_message_string(&self) -> String
Formats self as a human-readable string for error messages.
Trait Implementations§
source§impl Clone for PortIndexValue
 
impl Clone for PortIndexValue
source§fn clone(&self) -> PortIndexValue
 
fn clone(&self) -> PortIndexValue
Returns a copy 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 PortIndexValue
 
impl Debug for PortIndexValue
source§impl<'de> Deserialize<'de> for PortIndexValue
 
impl<'de> Deserialize<'de> for PortIndexValue
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 Display for PortIndexValue
 
impl Display for PortIndexValue
source§impl From<PortIndex> for PortIndexValue
 
impl From<PortIndex> for PortIndexValue
source§impl Ord for PortIndexValue
 
impl Ord for PortIndexValue
source§impl PartialEq for PortIndexValue
 
impl PartialEq for PortIndexValue
source§impl PartialOrd for PortIndexValue
 
impl PartialOrd for PortIndexValue
source§impl Serialize for PortIndexValue
 
impl Serialize for PortIndexValue
impl Eq for PortIndexValue
Auto Trait Implementations§
impl Freeze for PortIndexValue
impl RefUnwindSafe for PortIndexValue
impl !Send for PortIndexValue
impl !Sync for PortIndexValue
impl Unpin for PortIndexValue
impl UnwindSafe for PortIndexValue
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more