VariableMeta

Struct VariableMeta 

Source
pub struct VariableMeta<VarId, ScopeId> {
    pub var: VariableRef<VarId, ScopeId>,
    pub num_bits: Option<u32>,
    pub variable_type: Option<VariableType>,
    pub variable_type_name: Option<String>,
    pub index: Option<VariableIndex>,
    pub direction: Option<VariableDirection>,
    pub enum_map: HashMap<String, String>,
    pub encoding: VariableEncoding,
}

Fields§

§var: VariableRef<VarId, ScopeId>§num_bits: Option<u32>§variable_type: Option<VariableType>

Type of the variable in the HDL (on a best effort basis).

§variable_type_name: Option<String>

Type name of variable, if available

§index: Option<VariableIndex>§direction: Option<VariableDirection>§enum_map: HashMap<String, String>§encoding: VariableEncoding

Indicates how the variable is stored. A variable of “type” boolean for example could be stored as a String or as a BitVector.

Implementations§

Source§

impl<VarId1, ScopeId1> VariableMeta<VarId1, ScopeId1>

Source

pub fn map_ids<VarId2, ScopeId2>( self, var_fn: impl FnMut(VarId1) -> VarId2, scope_fn: impl FnMut(ScopeId1) -> ScopeId2, ) -> VariableMeta<VarId2, ScopeId2>

Trait Implementations§

Source§

impl<VarId: Clone, ScopeId: Clone> Clone for VariableMeta<VarId, ScopeId>

Source§

fn clone(&self) -> VariableMeta<VarId, ScopeId>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<VarId: Debug, ScopeId: Debug> Debug for VariableMeta<VarId, ScopeId>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, VarId, ScopeId> Deserialize<'de> for VariableMeta<VarId, ScopeId>
where VarId: Deserialize<'de>, ScopeId: Deserialize<'de>,

Source§

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<VarId, ScopeId> FromBytesOwned for VariableMeta<VarId, ScopeId>
where Json<Self>: FromBytesOwned,

Source§

fn from_bytes_owned(__data: &[u8]) -> Result<Self, Error>

Decode a value from a slice of bytes, the resulting value should not borrow the input data.
Source§

impl<VarId, ScopeId> Serialize for VariableMeta<VarId, ScopeId>
where VarId: Serialize, ScopeId: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'__to_bytes_a, VarId, ScopeId> ToBytes<'__to_bytes_a> for VariableMeta<VarId, ScopeId>
where for<'__to_bytes_b> Json<&'__to_bytes_b Self>: ToBytes<'__to_bytes_b>,

Source§

type Bytes = Vec<u8>

A configurable byte slice representation, allows any type that implements AsRef<[u8]>
Source§

fn to_bytes(&self) -> Result<Self::Bytes, Error>

to_bytes converts a value into Self::Bytes

Auto Trait Implementations§

§

impl<VarId, ScopeId> Freeze for VariableMeta<VarId, ScopeId>
where VarId: Freeze, ScopeId: Freeze,

§

impl<VarId, ScopeId> RefUnwindSafe for VariableMeta<VarId, ScopeId>
where VarId: RefUnwindSafe, ScopeId: RefUnwindSafe,

§

impl<VarId, ScopeId> Send for VariableMeta<VarId, ScopeId>
where VarId: Send, ScopeId: Send,

§

impl<VarId, ScopeId> Sync for VariableMeta<VarId, ScopeId>
where VarId: Sync, ScopeId: Sync,

§

impl<VarId, ScopeId> Unpin for VariableMeta<VarId, ScopeId>
where VarId: Unpin, ScopeId: Unpin,

§

impl<VarId, ScopeId> UnwindSafe for VariableMeta<VarId, ScopeId>
where VarId: UnwindSafe, ScopeId: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromBytes<'a> for T
where T: FromBytesOwned,

Source§

fn from_bytes(data: &'a [u8]) -> Result<T, Error>

Decode a value from a slice of bytes
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,