[][src]Struct logicsim::circuits::WordInput

pub struct WordInput { /* fields omitted */ }

Data Structure that allows you to easily manage a group of LeverHandles.

Implementations

impl WordInput[src]

pub fn new<S: Into<String>>(
    g: &mut GateGraphBuilder,
    width: usize,
    name: S
) -> Self
[src]

Returns a new WordInput of width width with name name.

pub fn update_bit(
    &self,
    g: &mut InitializedGateGraph,
    bit: usize,
    value: bool
) -> Option<()>
[src]

Sets the lever at index bit to value.

pub fn flip_bit(&self, g: &mut InitializedGateGraph, bit: usize) -> Option<()>[src]

Flips the lever at index bit.

pub fn set_bit(&self, g: &mut InitializedGateGraph, bit: usize) -> Option<()>[src]

Sets the lever at index bit to true.

pub fn reset_bit(&self, g: &mut InitializedGateGraph, bit: usize) -> Option<()>[src]

Sets the lever at index bit to false.

pub fn set_to<T: Copy + Sized + 'static>(
    &self,
    g: &mut InitializedGateGraph,
    value: T
)
[src]

Sets the levers to the native endian bits of value. If size_of_val(value) > self.len(), it will ignore the excess bits. If size_of_val(value) < self.len(), it will 0 extend the value.

pub fn set(&self, g: &mut InitializedGateGraph)[src]

Sets all the levers to true.

pub fn reset(&self, g: &mut InitializedGateGraph)[src]

Sets all the levers to false.

pub fn bits(&self) -> SmallVec<[GateIndex; 8]>[src]

Returns a SmallVec<GateIndex> to connect to other components.

pub fn len(&self) -> usize[src]

Returns the width of the WordInput.

pub fn is_empty(&self) -> bool[src]

Returns true the width of the WordInput == 0.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.