pub struct BSC {
pub birth: Birth,
pub survival: Survival,
pub generation: Generation,
}Expand description
A ruleset containing birth, survival, and generation (B/S/C) rules.
Fields§
§birth: Birth§survival: Survival§generation: GenerationImplementations§
Source§impl BSC
impl BSC
Sourcepub fn new(b: &[u8], s: &[u8], c: u8) -> Self
pub fn new(b: &[u8], s: &[u8], c: u8) -> Self
Constructs a new ruleset containing birth, survival, and generation rules.
§Examples
use cellular_automaton::ruleset::BSC;
let rules = BSC::default();
// = BSC::new(&[3], &[2, 3], 2);
// = BSC {
// birth: vec![3],
// survival: vec![2, 3],
// generation: 1,
// };
assert_eq!(rules.birth, vec![3]);
assert_eq!(rules.survival, vec![2, 3]);
assert_eq!(rules.generation, 1);Trait Implementations§
Source§impl FromWasmAbi for BSC
impl FromWasmAbi for BSC
Source§impl IntoWasmAbi for BSC
impl IntoWasmAbi for BSC
Source§impl LongRefFromWasmAbi for BSC
impl LongRefFromWasmAbi for BSC
Source§impl OptionFromWasmAbi for BSC
impl OptionFromWasmAbi for BSC
Source§impl OptionIntoWasmAbi for BSC
impl OptionIntoWasmAbi for BSC
Source§impl PartialOrd for BSC
impl PartialOrd for BSC
Source§impl RefFromWasmAbi for BSC
impl RefFromWasmAbi for BSC
Source§impl RefMutFromWasmAbi for BSC
impl RefMutFromWasmAbi for BSC
impl StructuralPartialEq for BSC
impl SupportsConstructor for BSC
impl SupportsInstanceProperty for BSC
impl SupportsStaticProperty for BSC
Source§impl TryFromJsValue for BSC
impl TryFromJsValue for BSC
Source§impl VectorFromWasmAbi for BSC
impl VectorFromWasmAbi for BSC
Source§impl VectorIntoWasmAbi for BSC
impl VectorIntoWasmAbi for BSC
Auto Trait Implementations§
impl Freeze for BSC
impl RefUnwindSafe for BSC
impl Send for BSC
impl Sync for BSC
impl Unpin for BSC
impl UnsafeUnpin for BSC
impl UnwindSafe for BSC
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.