Skip to main content

EntityBase

Struct EntityBase 

Source
pub struct EntityBase {
    damage_history: DamageHistoryBinding,
    generation: EntityGeneration,
    id: i32,
    uuid: Uuid,
    world: SyncMutex<Weak<World>>,
    state: SyncMutex<EntityBaseState>,
    save_data: SyncMutex<EntityBaseSaveData>,
    movement_trace: SyncMutex<EntityMovementTrace>,
    lifecycle: SyncMutex<EntityLifecycleState>,
    relationships: SyncMutex<EntityRelationshipState>,
    portal_process: SyncMutex<Option<PortalProcessor>>,
    level_callback: SyncMutex<Arc<dyn EntityLevelCallback>>,
}
Expand description

Common fields and methods shared by all entities.

Entities embed this struct to avoid duplicating core identity, position, and lifecycle management code. The Entity trait implementation can then delegate to EntityBase methods for common functionality.

§Example

ⓘ
pub struct MyEntity {
    base: EntityBase,
    // Entity-specific fields...
}

impl Entity for MyEntity {
    fn id(&self) -> i32 { self.base.id() }
    fn uuid(&self) -> Uuid { self.base.uuid() }
    fn position(&self) -> DVec3 { self.base.position() }
    // ... delegate other common methods ...

    // Entity-specific implementations:
    fn entity_type(&self) -> EntityTypeRef { vanilla_entities::MY_ENTITY }
    fn tick(&self) { /* custom tick logic */ }
}

Fields§

§damage_history: DamageHistoryBinding§generation: EntityGeneration

Generation counter for this runtime construction of the entity.

§id: i32

Unique network ID for this entity (session-local).

§uuid: Uuid

Persistent UUID for this entity.

§world: SyncMutex<Weak<World>>

The world this entity is in.

§state: SyncMutex<EntityBaseState>

Current vanilla movement state.

§save_data: SyncMutex<EntityBaseSaveData>

Shared vanilla save data outside the movement snapshot.

§movement_trace: SyncMutex<EntityMovementTrace>

Per-tick movement segments used by vanilla block-contact effects.

§lifecycle: SyncMutex<EntityLifecycleState>

Removal and tick bookkeeping.

§relationships: SyncMutex<EntityRelationshipState>

Passenger, vehicle, and boarding-cooldown state.

§portal_process: SyncMutex<Option<PortalProcessor>>

Active vanilla portal timing state.

§level_callback: SyncMutex<Arc<dyn EntityLevelCallback>>

Callback for entity lifecycle events.

Implementations§

Source§

impl EntityBase

Source

pub fn new( id: i32, position: DVec3, dimensions: EntityDimensions, world: Weak<World>, ) -> Self

Creates a new EntityBase with a randomly generated UUID.

Source

pub fn new_with_state( id: i32, state: EntityBaseState, world: Weak<World>, ) -> Self

Creates a new EntityBase with a randomly generated UUID and explicit state.

Source

pub fn with_uuid( id: i32, uuid: Uuid, position: DVec3, dimensions: EntityDimensions, world: Weak<World>, ) -> Self

Creates a new EntityBase with the specified UUID.

Use this when loading entities from disk or when the UUID is known.

Source

pub fn with_uuid_and_state( id: i32, uuid: Uuid, state: EntityBaseState, world: Weak<World>, ) -> Self

Creates a new EntityBase with the specified UUID and restored movement state.

Use this when loading entities from disk so the vanilla base fields are reconstructed in one place.

Source

pub fn from_load(load: EntityBaseLoad, dimensions: EntityDimensions) -> Self

Creates a base from persistent vanilla entity fields.

Source

pub(crate) const fn damage_history(&self) -> &DamageHistoryBinding

Source

pub const fn generation(&self) -> EntityGeneration

Gets the generation counter of this runtime construction of the entity.

Source

pub const fn id(&self) -> i32

Gets the entity’s unique network ID.

Source

pub const fn uuid(&self) -> Uuid

Gets the entity’s UUID.

Source

pub fn position(&self) -> DVec3

Gets the entity’s current position.

Source

pub fn old_position(&self) -> DVec3

Gets the entity position used by vanilla movement traces.

Source

pub fn known_speed(&self) -> DVec3

Returns vanilla lastKnownSpeed, the displacement computed at base-tick start.

Source

pub fn tick_count(&self) -> i32

Returns the number of ticks this entity has existed for.

Source

pub fn is_first_tick(&self) -> bool

Returns whether the entity has not completed its first tick.

Source

pub fn set_first_tick(&self, first_tick: bool)

Sets whether the entity has not completed its first tick.

Source

pub fn bounding_box(&self) -> WorldAabb

Gets the entity’s current bounding box.

Source

pub(crate) fn physics_state( &self, input: EntityPhysicsStateInput, ) -> EntityPhysicsState

Returns the vanilla movement physics snapshot from the current base state.

Source

pub fn pose(&self) -> EntityPose

Gets the entity’s current pose.

Source

pub fn dimensions(&self) -> EntityDimensions

Gets the entity’s current dimensions.

Source

pub fn velocity(&self) -> DVec3

Gets the entity’s current velocity in blocks per tick.

Source

pub fn rotation(&self) -> (f32, f32)

Gets the entity’s rotation as (yaw, pitch) in degrees.

Source

pub fn old_rotation(&self) -> (f32, f32)

Gets vanilla yRotO/xRotO as (yaw, pitch) in degrees.

Source

pub fn on_ground(&self) -> bool

Returns true if the entity is touching the ground.

Source

pub fn movement_flags(&self) -> EntityMovementFlags

Returns the current vanilla movement flag snapshot.

Source

pub fn ground_contact(&self) -> EntityGroundContact

Returns the current vanilla ground-contact snapshot.

Source

pub fn movement_progress(&self) -> EntityMovementProgress

Returns vanilla movement side-effect progress counters.

Source

pub fn fire_freeze_state(&self) -> EntityFireFreezeState

Returns the current vanilla fire/freeze state.

Source

pub fn save_data(&self) -> EntityBaseSaveData

Returns a snapshot of shared vanilla save data.

Source

pub fn replace_save_data(&self, save_data: EntityBaseSaveData)

Replaces shared vanilla save data.

Source

pub fn in_block_state(&self, world: &World) -> BlockStateId

Returns vanilla Entity.getInBlockState, cached until base tick or block-position change.

Source

pub fn set_fire_freeze_state(&self, fire_freeze: EntityFireFreezeState)

Replaces the current vanilla fire/freeze state.

Source

pub fn horizontal_collision(&self) -> bool

Returns true if the last movement was clipped horizontally.

Source

pub fn vertical_collision(&self) -> bool

Returns true if the last movement was clipped vertically.

Source

pub fn vertical_collision_below(&self) -> bool

Returns true if the last vertical collision was below the entity.

Source

pub fn supporting_block(&self) -> Option<BlockPos>

Returns the block currently supporting this entity, if known.

Source

pub fn on_ground_no_blocks(&self) -> bool

Returns true when the entity is grounded but no supporting block was found.

Source

pub fn fluid_contact(&self) -> EntityFluidContact

Returns cached fluid contact from the last entity fluid refresh.

Source

pub fn was_eye_in_water(&self) -> bool

Returns vanilla wasEyeInWater from the previous fluid refresh.

Source

pub fn was_touching_water(&self) -> bool

Returns whether the last base-tick fluid refresh found water.

Source

pub fn fall_distance(&self) -> f64

Returns accumulated vanilla fall distance.

Source

pub fn no_physics(&self) -> bool

Returns true when movement bypasses collision physics.

Source

pub(crate) fn unmounted_push_state(&self) -> Option<EntityPushState>

Reads the push inputs under one lock, or None while riding so the caller falls back to the regular push callbacks.

Source

pub fn air_supply(&self) -> i32

Returns this entity’s current air supply in ticks.

Source

pub fn portal_cooldown(&self) -> i32

Returns the vanilla portal cooldown in ticks.

Source

pub fn is_on_portal_cooldown(&self) -> bool

Returns whether the entity is on vanilla portal cooldown.

Source

pub fn portal_process(&self) -> Option<PortalProcessor>

Returns the active vanilla portal process, if the entity is charging a portal.

Source

pub fn no_gravity(&self) -> bool

Returns whether this entity ignores gravity.

Source

pub fn invulnerable(&self) -> bool

Returns whether this entity is invulnerable to non-bypassing damage.

Source

pub fn custom_name(&self) -> Option<TextComponent>

Returns the optional vanilla custom name.

Source

pub fn custom_name_visible(&self) -> bool

Returns the vanilla custom-name visibility flag.

Source

pub fn silent(&self) -> bool

Returns the synchronized vanilla silent flag.

Source

pub fn glowing(&self) -> bool

Returns the server-owned vanilla glowing tag flag.

Source

pub fn tags(&self) -> Vec<String>

Returns a sorted snapshot of vanilla scoreboard tags.

Source

pub fn custom_data(&self) -> NbtCompound

Returns a snapshot of vanilla custom data.

Source

pub fn needs_velocity_sync(&self) -> bool

Returns whether this entity’s velocity has changed enough to need syncing to clients.

Source

pub fn hurt_marked(&self) -> bool

Returns true when vanilla hurt-marked velocity sync is pending.

Source

pub fn requires_precise_position(&self) -> bool

Returns true when tracker movement sync must send a full position packet.

Source

pub fn set_requires_precise_position(&self, requires_precise_position: bool)

Sets whether tracker movement sync must send a full position packet.

Source

pub fn level(&self) -> Option<Arc<World>>

Gets the world this entity is in.

Returns None if the world has been dropped.

Source

pub fn vehicle(&self) -> Option<SharedEntity>

Gets the vehicle this entity is riding, if it is still loaded.

Source

pub fn passengers(&self) -> Vec<SharedEntity> ⓘ

Gets this entity’s direct passengers, pruning stale weak references.

Source

pub fn first_passenger(&self) -> Option<SharedEntity>

Gets this entity’s first direct passenger, if present.

Source

pub fn is_vehicle(&self) -> bool

Returns true when this entity has at least one direct passenger.

Source

pub fn has_passenger_id(&self, passenger_id: i32) -> bool

Returns true when the entity ID is a direct passenger.

Source

pub fn boarding_cooldown(&self) -> i32

Returns the vanilla boarding cooldown in ticks.

Source

pub(crate) fn remove_passenger_id(&self, passenger_id: i32) -> bool

Removes a direct passenger by entity ID.

Source

pub fn stop_riding(&self)

Stops riding the current vehicle, if any.

Source

pub(crate) fn restore_passenger_relationship( vehicle: &SharedEntity, passenger: &SharedEntity, )

Restores a persisted passenger relationship without applying gameplay boarding rules.

Source

pub(crate) fn start_riding_relationship( vehicle: &SharedEntity, passenger: &SharedEntity, )

Starts a gameplay passenger relationship after vanilla boarding rules pass.

Source

fn add_passenger_relationship(vehicle: &SharedEntity, passenger: &SharedEntity)

Source

pub(crate) fn set_boarding_cooldown(&self, boarding_cooldown: i32)

Sets the vanilla boarding cooldown in ticks.

Source

pub fn advance_base_tick_state(&self)

Advances the base-tick movement and relationship state Steel currently implements.

Source

fn clear_in_block_state_for_base_tick(&self)

Clears vanilla inBlockState at the start of base tick.

Source

pub fn compute_known_speed(&self)

Computes vanilla lastKnownSpeed from the previous base-tick position.

Source

fn decrement_boarding_cooldown(&self)

Source

pub fn process_portal_cooldown(&self)

Advances vanilla portal cooldown by one server tick.

Source

pub(crate) fn set_world(&self, world: Weak<World>)

Updates the world reference used by this entity.

Source

pub fn begin_pending_world_change(&self) -> Option<PendingWorldChangeToken>

Marks this entity as waiting for a prepared world change.

Source

pub(crate) fn begin_pending_player_respawn( &self, ) -> Option<PendingWorldChangeToken>

Marks a live or killed player as waiting for respawn preparation.

Killed players remain eligible because their async spawn search may need to be retried after the death animation removes their live entity.

Source

pub fn finish_pending_world_change( &self, token: PendingWorldChangeToken, ) -> bool

Clears a pending world change if it still matches the provided token.

Source

pub fn is_world_change_pending(&self) -> bool

Returns true while this entity is waiting for a prepared world change.

Source

pub fn is_world_change_token_pending( &self, token: PendingWorldChangeToken, ) -> bool

Returns true if the given world-change token is still pending.

Source

pub fn is_removed(&self) -> bool

Returns true if the entity has been marked for removal.

Source

pub fn removal_reason(&self) -> Option<RemovalReason>

Returns the reason this entity was removed, if it has been removed.

Source

pub fn set_removed(&self, reason: RemovalReason)

Marks the entity as removed with the given reason.

Notifies the level callback on first removal.

Source

fn detach_from_relationships(&self, reason: RemovalReason)

Source

fn stop_riding_relationship(&self)

Source

fn eject_passenger_relationships(&self)

Source

fn clear_vehicle_if(&self, vehicle_id: i32) -> bool

Source

pub fn clear_removed(&self) -> bool

Clears the removed flag and returns whether the entity had been removed.

Vanilla uses this when an entity instance itself survives a world change. Previously downgraded history stays weak; a new hit can retain a new source.

Source

pub fn set_level_callback(&self, callback: Arc<dyn EntityLevelCallback>)

Sets the level callback for lifecycle events.

Source

pub fn try_set_position(&self, pos: DVec3) -> Result<(), EntityMoveError>

Sets the entity’s position through the active level callback.

Source

pub(crate) fn set_position_local(&self, pos: DVec3)

Sets position without consulting world lifecycle callbacks.

Use this for construction, loading, proto-staged entities, and tests.

Source

fn set_position_local_unchecked(&self, pos: DVec3)

Source

pub fn set_old_position_to_current(&self)

Sets the vanilla movement-trace old position to the current position.

Source

pub fn set_old_position(&self, old_position: DVec3)

Sets the vanilla movement-trace old position explicitly.

Source

pub fn set_old_rotation_to_current(&self)

Copies the current rotation into the old-rotation snapshot used for interpolation.

Source

pub fn set_old_yaw_to_current(&self)

Sets vanilla yRotO to the current yaw without changing xRotO.

Source

pub fn set_old_rotation(&self, old_rotation: (f32, f32))

Sets the old-rotation snapshot explicitly, normalizing the angles.

Source

pub fn record_movement_this_tick(&self, movement: EntityMovement)

Records a movement segment for vanilla block-contact effects.

Source

pub fn remove_latest_movement_recording(&self)

Removes the latest movement segment recorded this tick.

Source

pub fn clear_movement_this_tick(&self)

Clears movement segments recorded for the current tick.

Source

pub fn take_movements_for_block_effects(&self) -> SmallVec<[EntityMovement; 1]>

Takes and finalizes this tick’s movement segments for block-contact effects.

Source

pub fn last_movements_for_block_effects(&self) -> SmallVec<[EntityMovement; 1]>

Returns the last finalized movement segments for vanilla block-contact effects.

Source

pub fn set_bounding_box(&self, bounding_box: WorldAabb)

Sets the entity’s bounding box directly.

Use this for vanilla entities whose box is not simply dimensions centered on the entity position.

Source

pub fn set_pose_and_dimensions( &self, pose: EntityPose, dimensions: EntityDimensions, )

Sets pose and dimensions, then rebuilds the default position-centered box.

Source

fn notify_bounding_box_changed(&self, bounding_box: WorldAabb)

Source

pub fn set_velocity(&self, velocity: DVec3)

Sets the entity’s velocity in blocks per tick.

Source

pub(crate) fn push_impulse(&self, impulse: DVec3)

Vanilla push(double, double, double) under one lock: a non-finite impulse is ignored, and a non-finite sum keeps the old velocity like setDeltaMovement while still marking the velocity for sync.

Source

pub fn advance_tick_count(&self)

Advances this entity’s tick counter by one.

Source

pub fn set_tick_count(&self, tick_count: i32)

Sets this entity’s tick counter, for entities that persist it.

Source

pub fn record_movement_progress( &self, clipped_movement: DVec3, climbing: bool, ) -> EntityMovementProgress

Records movement distance used by vanilla step, swim, and flap effects.

Source

pub fn set_next_step(&self, next_step: f32)

Stores vanilla nextStep after a produced movement side effect.

Source

pub fn amethyst_step_sound( &self, tick_count: i32, ) -> Option<EntityAmethystStepSound>

Returns vanilla amethyst-step chime parameters when the cooldown allows it.

Source

pub fn set_rotation(&self, rotation: (f32, f32))

Sets the entity’s rotation as (yaw, pitch) in degrees.

Source

pub fn set_no_physics(&self, no_physics: bool)

Sets whether this entity bypasses collision physics.

Source

pub fn set_air_supply(&self, air_supply: i32)

Sets this entity’s air supply in ticks.

Source

pub fn set_portal_cooldown(&self, portal_cooldown: i32)

Sets the vanilla portal cooldown in ticks.

Source

pub fn set_as_inside_portal(&self, portal: PortalKind, entry_position: BlockPos)

Marks this entity as inside a vanilla portal during the current tick.

Source

pub fn process_portal_teleportation( &self, allowed_to_teleport: bool, transition_time: i32, ) -> Option<PortalProcessResult>

Advances the active vanilla portal process, if one exists.

Source

pub(crate) fn set_portal_process(&self, portal_process: Option<PortalProcessor>)

Replaces active portal timing state during vanilla player restoration.

Source

pub fn clear_portal_process(&self)

Clears the active vanilla portal process.

Source

pub fn set_no_gravity(&self, no_gravity: bool)

Sets whether this entity ignores gravity.

Source

pub fn set_invulnerable(&self, invulnerable: bool)

Sets whether this entity is invulnerable to non-bypassing damage.

Source

pub fn set_custom_name(&self, custom_name: Option<TextComponent>)

Sets the optional vanilla custom name.

Source

pub fn set_custom_name_visible(&self, visible: bool)

Sets the vanilla custom-name visibility flag.

Source

pub fn set_silent(&self, silent: bool)

Sets the synchronized vanilla silent flag.

Source

pub fn set_glowing(&self, glowing: bool)

Sets the server-owned vanilla glowing tag flag.

Source

pub fn add_tag(&self, tag: String) -> bool

Adds a vanilla scoreboard tag.

Source

pub fn remove_tag(&self, tag: &str) -> bool

Removes a vanilla scoreboard tag.

Source

pub fn set_custom_data(&self, custom_data: NbtCompound)

Replaces vanilla custom data.

Source

pub fn mark_velocity_sync(&self)

Marks this entity’s velocity as needing to be synced to clients.

Source

pub fn clear_velocity_sync(&self)

Clears the vanilla velocity sync marker after send processing.

Source

pub fn mark_hurt(&self)

Marks this entity as hurt for vanilla self-inclusive motion sync.

Source

pub fn clear_hurt_mark(&self)

Clears the vanilla hurt-marked motion sync flag.

Source

pub fn set_fall_distance(&self, fall_distance: f64)

Sets accumulated vanilla fall distance.

Source

pub fn accumulate_fall_distance(&self, vertical_movement: f64)

Adds vertical movement to accumulated fall distance using vanilla precision.

Source

pub fn reset_fall_distance(&self)

Resets accumulated vanilla fall distance.

Source

pub fn remaining_fire_ticks(&self) -> i32

Returns the ticks remaining before this entity stops burning.

Source

pub fn set_remaining_fire_ticks(&self, remaining_fire_ticks: i32)

Sets the ticks remaining before this entity stops burning.

Source

pub fn ticks_frozen(&self) -> i32

Returns ticks this entity has spent freezing in powder snow.

Source

pub fn set_ticks_frozen(&self, ticks_frozen: i32)

Sets ticks this entity has spent freezing in powder snow.

Source

pub fn is_in_powder_snow(&self) -> bool

Returns whether the entity touched powder snow during the current tick.

Source

pub fn was_in_powder_snow(&self) -> bool

Returns whether the entity touched powder snow during the previous tick.

Source

pub fn set_visual_fire(&self, has_visual_fire: bool)

Sets whether this entity currently renders as visually on fire.

Source

pub fn has_visual_fire(&self) -> bool

Returns whether this entity currently renders as visually on fire.

Source

pub fn is_on_fire(&self, fire_immune: bool) -> bool

Returns whether the entity is on fire on the server.

Source

pub fn is_freezing(&self) -> bool

Returns whether the entity is freezing.

Source

pub fn is_fully_frozen(&self, ticks_required_to_freeze: i32) -> bool

Returns whether the entity has reached full-freeze duration.

Source

pub fn advance_powder_snow_contact_for_base_tick(&self)

Advances vanilla powder-snow contact at the start of base tick.

Source

pub fn advance_fire_tick(&self, fire_immune: bool, in_lava: bool) -> bool

Advances vanilla server-side fire tick state.

Returns true when the caller should apply one tick of on-fire damage.

Source

pub fn clear_freeze(&self)

Clears accumulated freezing.

Source

pub fn clear_fire(&self)

Clears fire without resetting the vanilla fire immunity cooldown.

Source

pub fn ignite_for_ticks( &self, number_of_ticks: i32, remaining_fire_ticks_cap: Option<i32>, )

Ignites this entity for a vanilla tick duration.

Source

pub fn apply_inside_block_effect( &self, effect_type: InsideBlockEffectType, can_freeze: bool, fire_immune: bool, fire_ignite_extra_ticks: i32, ticks_required_to_freeze: i32, remaining_fire_ticks_cap: Option<i32>, )

Applies a vanilla inside-block effect to base fire/freeze state.

Source

fn apply_fire_ignite( fire_freeze: &mut EntityFireFreezeState, fire_immune: bool, fire_ignite_extra_ticks: i32, remaining_fire_ticks_cap: Option<i32>, )

Source

fn ignite_for_ticks_in_state( fire_freeze: &mut EntityFireFreezeState, number_of_ticks: i32, remaining_fire_ticks_cap: Option<i32>, )

Source

fn set_remaining_fire_ticks_in_state( fire_freeze: &mut EntityFireFreezeState, remaining_fire_ticks: i32, remaining_fire_ticks_cap: Option<i32>, )

Source

fn cap_remaining_fire_ticks( remaining_fire_ticks: i32, remaining_fire_ticks_cap: Option<i32>, ) -> i32

Source

pub fn dampen_fall_distance_in_lava(&self)

Applies vanilla base-tick fall-distance damping while touching lava.

Source

pub fn reset_fall_distance_in_water(&self)

Applies vanilla fluid-interaction fall-distance reset while touching water.

Source

pub fn set_on_ground(&self, on_ground: bool)

Sets whether this entity is touching the ground.

Source

pub fn set_movement_flags( &self, movement_flags: EntityMovementFlags, ground_contact: EntityGroundContact, )

Sets all vanilla movement flags after Entity.move.

Source

pub fn set_ground_contact(&self, ground_contact: EntityGroundContact)

Stores the current vanilla supporting-block snapshot.

Source

pub fn set_fluid_contact(&self, fluid_contact: EntityFluidContact)

Stores the current vanilla fluid contact snapshot.

Source

pub fn is_in_lava(&self) -> bool

Returns whether the entity is currently touching lava.

Source

pub fn update_was_eye_in_water(&self)

Records eye-water history from the cached fluid contact. Vanilla does this only in baseTick, before refreshing fluid interaction.

Source

pub fn set_fluid_interaction(&self, fluid_contact: EntityFluidContact)

Stores fluid contact from a vanilla updateFluidInteraction refresh, including wasTouchingWater.

Source

pub fn set_on_ground_with_movement( &self, on_ground: bool, horizontal_collision: bool, ground_contact: EntityGroundContact, )

Sets ground and horizontal collision flags from an accepted client move.

Source

pub fn clear_collision_flags(&self)

Clears collision flags after a no-physics move.

Source

pub fn limit_piston_movement( &self, movement: DVec3, current_game_time: i64, ) -> DVec3

Applies vanilla per-tick piston movement accumulation.

Source

pub fn make_stuck_in_block(&self, speed_multiplier: DVec3)

Sets the speed multiplier used for the next stuck-in-block movement pass.

Source

pub fn consume_stuck_speed_multiplier( &self, movement: DVec3, apply_multiplier: bool, ) -> DVec3

Applies and clears vanilla stuck-in-block speed state.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoShared for T

Source§

fn into_shared(self) -> Arc<Mutex<RawMutex, Self>> ⓘ

Wraps this value in an Arc<SyncMutex<>>
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more