[−][src]Struct logicsim::graph::GateIndex
Represents the index of a logic gate in a super::GateGraphBuilder.
Implementations
impl GateIndex
[src]
pub fn is_off(&self) -> bool
[src]
Returns true if self
is the index of the OFF constant.
pub fn is_on(&self) -> bool
[src]
Returns true if self
is the index of the ON constant.
pub fn is_const(&self) -> bool
[src]
Returns true if self
is ON or OFF.
Example
let mut g = GateGraphBuilder::new(); let and = g.and("and"); assert_eq!(and.is_const(), false); assert_eq!(ON.is_const(), true); assert_eq!(OFF.is_const(), true);
pub fn opposite_if_const(&self) -> Option<GateIndex>
[src]
Returns Some(OFF) if self
is ON, Some(ON) if self
is off, None otherwise.
Example
let mut g = GateGraphBuilder::new(); let and = g.and("and"); assert_eq!(and.opposite_if_const(), None); assert_eq!(ON.opposite_if_const(), Some(OFF)); assert_eq!(OFF.opposite_if_const(), Some(ON));
Trait Implementations
impl Clone for GateIndex
[src]
impl Copy for GateIndex
[src]
impl Debug for GateIndex
[src]
impl Display for GateIndex
[src]
impl Eq for GateIndex
[src]
impl From<SlabIndex> for GateIndex
[src]
impl Hash for GateIndex
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<SlabIndex> for GateIndex
[src]
impl<'_> Into<SlabIndex> for &'_ GateIndex
[src]
impl Ord for GateIndex
[src]
pub fn cmp(&self, other: &GateIndex) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<GateIndex> for GateIndex
[src]
impl PartialOrd<GateIndex> for GateIndex
[src]
pub fn partial_cmp(&self, other: &GateIndex) -> Option<Ordering>
[src]
pub fn lt(&self, other: &GateIndex) -> bool
[src]
pub fn le(&self, other: &GateIndex) -> bool
[src]
pub fn gt(&self, other: &GateIndex) -> bool
[src]
pub fn ge(&self, other: &GateIndex) -> bool
[src]
impl StructuralEq for GateIndex
[src]
impl StructuralPartialEq for GateIndex
[src]
Auto Trait Implementations
impl RefUnwindSafe for GateIndex
impl Send for GateIndex
impl Sync for GateIndex
impl Unpin for GateIndex
impl UnwindSafe for GateIndex
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<N> NodeTrait for N where
N: Copy + Ord + Hash,
[src]
N: Copy + Ord + Hash,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,