pub trait VArrayOpBuilder: GenericArrayOpBuilder {
// Provided methods
fn add_new_value_array(
&mut self,
elem_ty: Type,
values: impl IntoIterator<Item = Wire>,
) -> Result<Wire, BuildError> { ... }
fn add_value_array_get(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index: Wire,
) -> Result<(Wire, Wire), BuildError> { ... }
fn add_value_array_set(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index: Wire,
value: Wire,
) -> Result<Wire, BuildError> { ... }
fn add_value_array_swap(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index1: Wire,
index2: Wire,
) -> Result<Wire, BuildError> { ... }
fn add_array_pop_left(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
) -> Result<Wire, BuildError> { ... }
fn add_array_pop_right(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
) -> Result<Wire, BuildError> { ... }
fn add_array_discard_empty(
&mut self,
elem_ty: Type,
input: Wire,
) -> Result<(), BuildError> { ... }
}
Expand description
Trait for building value array operations in a dataflow graph.
Provided Methods§
Sourcefn add_new_value_array(
&mut self,
elem_ty: Type,
values: impl IntoIterator<Item = Wire>,
) -> Result<Wire, BuildError>
fn add_new_value_array( &mut self, elem_ty: Type, values: impl IntoIterator<Item = Wire>, ) -> Result<Wire, BuildError>
Adds a new array operation to the dataflow graph and return the wire representing the new array.
§Arguments
elem_ty
- The type of the elements in the array.values
- An iterator over the values to initialize the array with.
§Errors
If building the operation fails.
§Returns
The wire representing the new array.
Sourcefn add_value_array_get(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index: Wire,
) -> Result<(Wire, Wire), BuildError>
fn add_value_array_get( &mut self, elem_ty: Type, size: u64, input: Wire, index: Wire, ) -> Result<(Wire, Wire), BuildError>
Adds an array get operation to the dataflow graph.
§Arguments
elem_ty
- The type of the elements in the array.size
- The size of the array.input
- The wire representing the array.index
- The wire representing the index to get.
§Errors
If building the operation fails.
§Returns
- The wire representing the value at the specified index in the array
- The wire representing the array
Sourcefn add_value_array_set(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index: Wire,
value: Wire,
) -> Result<Wire, BuildError>
fn add_value_array_set( &mut self, elem_ty: Type, size: u64, input: Wire, index: Wire, value: Wire, ) -> Result<Wire, BuildError>
Adds an array set operation to the dataflow graph.
This operation sets the value at a specified index in the array.
§Arguments
elem_ty
- The type of the elements in the array.size
- The size of the array.input
- The wire representing the array.index
- The wire representing the index to set.value
- The wire representing the value to set at the specified index.
§Errors
Returns an error if building the operation fails.
§Returns
The wire representing the updated array after the set operation.
Sourcefn add_value_array_swap(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
index1: Wire,
index2: Wire,
) -> Result<Wire, BuildError>
fn add_value_array_swap( &mut self, elem_ty: Type, size: u64, input: Wire, index1: Wire, index2: Wire, ) -> Result<Wire, BuildError>
Adds an array swap operation to the dataflow graph.
This operation swaps the values at two specified indices in the array.
§Arguments
elem_ty
- The type of the elements in the array.size
- The size of the array.input
- The wire representing the array.index1
- The wire representing the first index to swap.index2
- The wire representing the second index to swap.
§Errors
Returns an error if building the operation fails.
§Returns
The wire representing the updated array after the swap operation.
Sourcefn add_array_pop_left(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
) -> Result<Wire, BuildError>
fn add_array_pop_left( &mut self, elem_ty: Type, size: u64, input: Wire, ) -> Result<Wire, BuildError>
Adds an array pop-left operation to the dataflow graph.
This operation removes the leftmost element from the array.
§Arguments
elem_ty
- The type of the elements in the array.size
- The size of the array.input
- The wire representing the array.
§Errors
Returns an error if building the operation fails.
§Returns
The wire representing the Option<elemty, array<SIZE-1, elemty>>
Sourcefn add_array_pop_right(
&mut self,
elem_ty: Type,
size: u64,
input: Wire,
) -> Result<Wire, BuildError>
fn add_array_pop_right( &mut self, elem_ty: Type, size: u64, input: Wire, ) -> Result<Wire, BuildError>
Adds an array pop-right operation to the dataflow graph.
This operation removes the rightmost element from the array.
§Arguments
elem_ty
- The type of the elements in the array.size
- The size of the array.input
- The wire representing the array.
§Errors
Returns an error if building the operation fails.
§Returns
The wire representing the Option<elemty, array<SIZE-1, elemty>>
Sourcefn add_array_discard_empty(
&mut self,
elem_ty: Type,
input: Wire,
) -> Result<(), BuildError>
fn add_array_discard_empty( &mut self, elem_ty: Type, input: Wire, ) -> Result<(), BuildError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.