pub trait BlockOperationsInterface: RpcDevice {
// Required methods
fn excavate(&self, side: Direction) -> Result<bool>
where bool: DeserializeOwned + 'static;
fn place(&self, side: Direction) -> Result<bool>
where bool: DeserializeOwned + 'static;
fn durability(&self) -> Result<i32>
where i32: DeserializeOwned + 'static;
fn repair(&self) -> Result<bool>
where bool: DeserializeOwned + 'static;
}Expand description
An interface between devices which carry out block operations and the HLAPI
Required Methods§
Sourcefn excavate(&self, side: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
fn excavate(&self, side: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
Mines the adjacent block on the given side. Returns true if the block was able to be mined.
Sourcefn place(&self, side: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
fn place(&self, side: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
Places a block on the given side. Returns true if the block was able to be placed.
Sourcefn durability(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn durability(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns a 32-bit signed integer that represents the durability of the currently active tool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.