Enum PartMapping
pub enum PartMapping<A: Arch> {
Imm {
mapping: Option<MappingOrBitOrder>,
locations: Vec<FlowInputLocation>,
bits: Option<ImmBits>,
},
MemoryComputation {
mapping: Vec<Option<AddressComputation>>,
memory_indexes: Vec<usize>,
},
Register {
mapping: Vec<Option<A::Reg>>,
locations: Vec<FlowValueLocation>,
},
}
Expand description
A part mapping in an encodin.
Variants§
Imm
An immediate value part mapping.
Fields
§
mapping: Option<MappingOrBitOrder>
A mapping of valid immediate values, or a bit ordering.
§
locations: Vec<FlowInputLocation>
The input locations affected by this part.
All input locations should be Source::Imm
s.
MemoryComputation
A memory computation part mapping.
Fields
§
mapping: Vec<Option<AddressComputation>>
The possible memory computations.
Register
A register part mapping.
Fields
§
locations: Vec<FlowValueLocation>
The sources/destinations that are affected by this part.
All sources/destinatons should be Source::Dest
s.
Implementations§
§impl<A: Arch> PartMapping<A>
impl<A: Arch> PartMapping<A>
pub fn register_mapping(&self) -> Option<&[Option<A::Reg>]>
pub fn register_mapping(&self) -> Option<&[Option<A::Reg>]>
Returns the mapping of registers if the part mapping is a register part mapping.
Otherwise, returns None
.
pub fn valid_values(&self) -> Option<impl Iterator<Item = usize> + '_>
pub fn valid_values(&self) -> Option<impl Iterator<Item = usize> + '_>
Returns an iterator that iterates over all valid values for this part.
pub fn first_valid_value(&self) -> u64
pub fn first_valid_value(&self) -> u64
Returns the smallest valid value for this part.
pub fn value_is_valid(&self, val: u64) -> bool
pub fn value_is_valid(&self, val: u64) -> bool
Returns whether the value val
is valid for this part.
Trait Implementations§
§impl<A: Clone + Arch> Clone for PartMapping<A>
impl<A: Clone + Arch> Clone for PartMapping<A>
§fn clone(&self) -> PartMapping<A>
fn clone(&self) -> PartMapping<A>
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 more§impl<A: Debug + Arch> Debug for PartMapping<A>
impl<A: Debug + Arch> Debug for PartMapping<A>
§impl<'de, A: Arch> Deserialize<'de> for PartMapping<A>
impl<'de, A: Arch> Deserialize<'de> for PartMapping<A>
§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
§impl<A: Hash + Arch> Hash for PartMapping<A>
impl<A: Hash + Arch> Hash for PartMapping<A>
§impl<A> JsonSchema for PartMapping<A>
impl<A> JsonSchema for PartMapping<A>
§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read more§impl<A: PartialEq + Arch> PartialEq for PartMapping<A>
impl<A: PartialEq + Arch> PartialEq for PartMapping<A>
§impl<A: Arch> Serialize for PartMapping<A>
impl<A: Arch> Serialize for PartMapping<A>
impl<A: Eq + Arch> Eq for PartMapping<A>
impl<A: Arch> StructuralPartialEq for PartMapping<A>
Auto Trait Implementations§
impl<A> Freeze for PartMapping<A>
impl<A> RefUnwindSafe for PartMapping<A>
impl<A> Send for PartMapping<A>
impl<A> Sync for PartMapping<A>
impl<A> Unpin for PartMapping<A>
impl<A> UnwindSafe for PartMapping<A>
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
)§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<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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