Struct FluidState
#[non_exhaustive]pub struct FluidState {
pub fluid: FluidKey,
pub amount: u8,
pub falling: bool,
pub source: bool,
}Expand description
A fluid state copied from the engine. For engine-built values, amount is zero exactly for the empty fluid. A mod may change a placement event’s copy; that mod-provided data is forwarded to later Parts and is never consumed by the engine.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fluid: FluidKeyRegistered fluid identity.
amount: u8Fluid amount; zero only for empty, otherwise 1 through 8.
falling: boolWhether the fluid is falling.
source: boolWhether the engine identifies this as a source.
Implementations§
§impl FluidState
impl FluidState
pub fn matches(self, constraints: &[StateConstraint]) -> bool
pub fn matches(self, constraints: &[StateConstraint]) -> bool
Match carried vanilla properties locally. Unknown names or noncanonical values
do not match. Validate against host.fluid_states() separately for indexed errors.
Trait Implementations§
§impl Clone for FluidState
impl Clone for FluidState
§fn clone(&self) -> FluidState
fn clone(&self) -> FluidState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FluidState
§impl Debug for FluidState
impl Debug for FluidState
impl Eq for FluidState
§impl PartialEq for FluidState
impl PartialEq for FluidState
impl StructuralPartialEq for FluidState
Auto Trait Implementations§
impl Freeze for FluidState
impl RefUnwindSafe for FluidState
impl Send for FluidState
impl Sync for FluidState
impl Unpin for FluidState
impl UnsafeUnpin for FluidState
impl UnwindSafe for FluidState
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