pub struct And<'a> {
pub input1: &'a Option<bool>,
pub input2: &'a Option<bool>,
}
Expand description
与门 全为true则为true 与门由两个与非门组成
§Examples
use logicgate::And;
use logicgate::LogicGate;
let a = And{input1: &Some(true),input2: &Some(false)};
let b = And{input1: &Some(true),input2: &Some(true)};
assert_eq!(a.get_result(),Some(false));
assert_eq!(b.get_result(),Some(true));
Fields§
§input1: &'a Option<bool>
§input2: &'a Option<bool>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for And<'a>
impl<'a> RefUnwindSafe for And<'a>
impl<'a> Send for And<'a>
impl<'a> Sync for And<'a>
impl<'a> Unpin for And<'a>
impl<'a> UnwindSafe for And<'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