pub struct Xor {
pub input1: bool,
pub input2: bool,
}
Expand description
异或门 输入不一样true
§Examples
use logicgate::Xor;
use logicgate::LogicGate;
let a = Xor{input1:true,input2:false};
let b = Xor{input1:true,input2:true};
let c = Xor{input1:false,input2:false};
assert_eq!(a.get_result(),true);
assert_eq!(b.get_result(),false);
assert_eq!(c.get_result(),false);
Fields§
§input1: bool
§input2: bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Xor
impl Send for Xor
impl Sync for Xor
impl Unpin for Xor
impl UnwindSafe for Xor
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