pub struct Block { /* private fields */ }
Expand description
A basic block defined by a name, its states and properties. This block structure is made especially for static definition, its states are computed lazily and almost all method requires a self reference with static lifetime.
Implementations§
Source§impl Block
impl Block
Sourcepub const fn new(name: &'static str, spec: BlockSpec) -> Self
pub const fn new(name: &'static str, spec: BlockSpec) -> Self
Construct a new block, this method should be used to define blocks statically.
The preferred way of defining static blocks is to use the blocks!
macro.
pub fn get_name(&self) -> &'static str
pub fn get_key(&'static self) -> BlockKey
pub fn get_default_state(&'static self) -> &'static BlockState
pub fn get_states(&'static self) -> &'static [BlockState]
Trait Implementations§
impl Eq for &'static Block
Auto Trait Implementations§
impl !Freeze for Block
impl !RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl !UnwindSafe for Block
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