Skip to main content

Server

Struct Server 

Source
pub struct Server {
Show 27 fields pub config: Arc<RuntimeConfig>, pub permission_groups: PermissionGroupManager, pub cancel_token: CancellationToken, pub key_store: KeyStore, pub registry_cache: RegistryCache, pub worlds: WorldMap, online_players: PlayerMap, player_admissions: SyncMutex<FxHashMap<Uuid, PlayerAdmissionState>>, pub tick_rate_manager: SyncRwLock<TickRateManager>, pub scoreboards: DomainScoreboards, pub(crate) command_storage: DomainCommandStorage, command_dispatcher: SyncRwLock<CommandDispatcher<CommandSource, SteelCommandRuntime>>, command_permission_keys: Vec<String>, command_requests: CommandRequestQueue, packet_processor: PacketProcessor, chunk_encoding_pool: Arc<ThreadPool>, pub jobs: ServerJobQueue, pub player_data_storage: PlayerDataStorage, player_permission_states: SyncRwLock<PermissionSubjectIndex>, player_permission_updates: AsyncMutex<()>, known_players: SyncMutex<KnownPlayerCacheState>, known_player_save_idle: Notify, profile_lookup_client: Client, pending_player_joins: PlayerJoinQueue, pending_player_disconnects: PlayerDisconnectQueue, pub pending_world_changes: SyncMutex<Vec<(SharedEntity, WorldChangeRequest)>>, pending_domain_switches: SyncMutex<Vec<DomainSwitchRequest>>,
}
Expand description

The main server struct.

Fields§

§config: Arc<RuntimeConfig>

Runtime configuration (view distance, compression, etc.).

§permission_groups: PermissionGroupManager

Runtime permission groups and their persistence boundary.

§cancel_token: CancellationToken

The cancellation token for graceful shutdown.

§key_store: KeyStore

The key store for the server.

§registry_cache: RegistryCache

The registry cache for the server.

§worlds: WorldMap

A list of all the worlds on the server.

§online_players: PlayerMap

Players currently connected to the server, independent of world membership.

§player_admissions: SyncMutex<FxHashMap<Uuid, PlayerAdmissionState>>

UUIDs reserved by a join or disconnect/save lifecycle transition.

§tick_rate_manager: SyncRwLock<TickRateManager>

The tick rate manager for the server.

§scoreboards: DomainScoreboards

Command scoreboards isolated by Steel domain.

§command_storage: DomainCommandStorage

Command NBT storage isolated by Steel domain.

§command_dispatcher: SyncRwLock<CommandDispatcher<CommandSource, SteelCommandRuntime>>

Saves and dispatches commands to appropriate handlers.

§command_permission_keys: Vec<String>

Steel-owned permission keys exposed for command autocomplete.

§command_requests: CommandRequestQueue

Command work submitted from connection and console tasks.

§packet_processor: PacketProcessor

Decoded serverbound play packets handled during the inter-tick phase.

§chunk_encoding_pool: Arc<ThreadPool>

Dedicated worker pool for CPU-heavy chunk persistence and packet encoding.

§jobs: ServerJobQueue

Jobs resumed from a known point in the server game tick.

§player_data_storage: PlayerDataStorage

Player data storage for saving/loading player state.

§player_permission_states: SyncRwLock<PermissionSubjectIndex>

Persisted permission state indexed by player UUID.

§player_permission_updates: AsyncMutex<()>

Serializes persistence and cache publication for player permission edits.

§known_players: SyncMutex<KnownPlayerCacheState>

Player identities and coalesced persistence state.

§known_player_save_idle: Notify

Wakes shutdown when the single known-player save worker becomes idle.

§profile_lookup_client: Client

HTTP client used by online-mode name-to-profile lookups.

§pending_player_joins: PlayerJoinQueue

Player joins prepared by async I/O and finalized at the game tick safe point.

§pending_player_disconnects: PlayerDisconnectQueue

Disconnected players waiting to be detached at the next game tick safe point.

§pending_world_changes: SyncMutex<Vec<(SharedEntity, WorldChangeRequest)>>

Queued world changes to process after the tick.

§pending_domain_switches: SyncMutex<Vec<DomainSwitchRequest>>

Queued domain switches to process after world ticks.

Implementations§

Source§

impl Server

Source

fn broadcast_system_chat( &self, message: &TextComponent, excluded_player: Option<Uuid>, )

Logs and broadcasts a system chat message to online players.

Source

pub(super) fn tab_list_components( tick_stats: TabListTickStats, ) -> (TextComponent, TextComponent)

Builds the tab list header/footer with recent and five-second tick statistics.

Source

pub(super) fn broadcast_tab_list(&self, tick_stats: TabListTickStats)

Broadcasts the tab list header/footer with current TPS and MSPT statistics.

Source

pub(crate) fn broadcast_sprint_report(&self, report: &SprintReport)

Broadcasts a sprint completion report to all players.

Source

pub(super) fn broadcast_player_join_message( &self, player: &Player, previous_name: Option<&str>, )

Source

pub(super) fn broadcast_player_leave_message(&self, player: &Player)

Source

pub fn broadcast_ticking_state(&self)

Broadcasts the current tick rate and frozen state to all clients. This should be called whenever the tick rate or frozen state changes.

Source

pub fn broadcast_ticking_step(&self)

Broadcasts the current step tick count to all clients. This should be called whenever the step tick count changes.

Source

pub fn send_ticking_state_to_player(&self, player: &Player)

Sends the current ticking state and step packets to a joining player. This should be called when a player joins the server.

Source

pub fn resend_player_context(self: &Arc<Self>, player: &Arc<Player>)

Resends client state that is not fully covered by CRespawn.

Source

pub fn resend_player_permission_context(self: &Arc<Self>, player: &Arc<Player>)

Resends the command tree and vanilla client permission-level projection.

Source§

impl Server

Source

pub async fn prepare_spawn_area(&self) -> bool

Generates the startup spawn area for the server default world.

Set PREGEN_SIZE to an odd chunk side length, or 0 to skip custom pregen. Set PREGEN_WINDOW_SIZE to override the default 32-chunk window side length. The configured size must fit the active-window unload-backpressure budget.

Source§

impl Server

Source

pub async fn run(self: Arc<Self>, cancel_token: CancellationToken)

Runs gameplay packets, game ticks, and chunk sending. Game-tick boundaries fork background chunk-scheduling epochs through each world’s task tracker.

Source

async fn run_game_tick(self: Arc<Self>, cancel_token: CancellationToken)

The main game tick loop (20 TPS, governed by tick rate manager).

Source

fn record_tick_and_capture_tab_stats( &self, tick_count: u64, tick_duration_nanos: u64, ) -> Option<TabListTickStats>

Source

async fn autosave_command_data(&self)

Source

fn tick_command_data_autosave( self: &Arc<Self>, next_autosave: &mut Instant, saves: &mut JoinSet<()>, )

Source

fn tick_pending_command_executions( &self, pending: &mut PendingCommandExecutionQueue<CommandSource>, )

Source

fn tick_command_requests( self: &Arc<Self>, pending: &mut PendingCommandExecutionQueue<CommandSource>, )

Source

fn execute_command_request( self: &Arc<Self>, pending: &mut PendingCommandExecutionQueue<CommandSource>, owner: CommandExecutionOwner, command: &str, )

Source

fn send_command_suggestions( self: &Arc<Self>, player: &Arc<Player>, transaction_id: i32, input: &str, )

Source

pub(super) fn build_command_suggestions( self: &Arc<Self>, sender: CommandSender, input: &str, ) -> Result<Suggestions, SuggestionError>

Source

async fn run_chunk_sending_tick( self: Arc<Self>, cancel_token: CancellationToken, )

Chunk sending tick loop — encodes and sends chunks to players independently.

Source

fn tick_chunk_sending(&self)

Executes one chunk sending tick across all worlds and players.

A per-world per-tick encode cache is used so overlapping view areas don’t re-encode the same chunk within a single tick.

Source

fn send_chunks_for_player( player: &Arc<Player>, world: &Arc<World>, encode_cache: &mut FxHashMap<ChunkPos, EncodedChunk>, encoding_pool: &ThreadPool, )

Three-phase chunk send for a single player: prepare (lock briefly), encode (no lock), commit (lock briefly + generation check).

Source

fn advance_chunk_scheduling(&self)

Commits ready chunk lifecycle epochs and forks the next background work.

Source

async fn tick_worlds_game( &self, workers: &WorldTickWorkers, tick_count: u64, runs_normally: bool, ) -> Result<(), WorldTickWorkerError>

Source

pub(super) fn tick_jobs(self: &Arc<Self>, tick_count: u64, runs_normally: bool)

Source§

impl Server

Source

pub fn known_players(&self) -> KnownPlayers

Returns a snapshot of player identities known to this server.

Source

pub fn record_known_player( self: &Arc<Self>, profile: &GameProfile, ) -> Option<String>

Records a connected player identity in the persistent profile cache. Returns the previous cached name for this UUID, if any.

Source

pub fn record_known_profile( self: &Arc<Self>, uuid: Uuid, last_known_name: impl Into<String>, )

Records a UUID and last-known name in the persistent profile cache.

Source

pub async fn resolve_player_profile( self: &Arc<Self>, name: &str, ) -> Result<KnownPlayer, ProfileLookupError>

Resolves a vanilla game-profile command target by name or UUID.

Online players and cached profiles are checked first. Uncached UUIDs remain direct UUID targets in either server mode. Offline-mode names use vanilla’s deterministic UUID, while online mode queries the configured profile service.

§Errors

Returns an error when the profile is unknown or the profile service fails.

Source

fn cached_player_profile(self: &Arc<Self>, name: &str) -> Option<KnownPlayer>

Source

fn start_known_player_save_worker(self: &Arc<Self>)

Source

async fn run_known_player_save_worker(self: &Arc<Self>)

Source

pub async fn flush_known_players(&self) -> Result<()>

Waits for the coalesced identity-cache writer and persists the final snapshot.

Later identity observations are ignored because the server is shutting down.

§Errors

Returns an error when the final rebuildable cache snapshot cannot be persisted.

Source§

impl Server

Source

pub(super) fn apply_cached_or_default_permission_state( &self, player: &Player, ) -> u64

Source

fn apply_player_permission_state( &self, player: &Player, state: PermissionSubjectState, ) -> u64

Source

pub fn player_permission_state( &self, uuid: Uuid, ) -> Option<PermissionSubjectState>

Returns one player’s cached persisted permission state.

Source

pub(crate) fn is_operator(&self, uuid: Uuid) -> bool

Returns whether the latest published subject state assigns the operator group.

Source

pub(crate) fn command_permission_snapshot(&self, uuid: Uuid) -> PermissionSet

Captures effective command permissions from the latest published subject and group state.

Source

pub async fn try_update_player_permissions<T, E>( self: &Arc<Self>, uuid: Uuid, update: impl FnOnce(PermissionSubjectState) -> Result<(PermissionSubjectState, T), E> + Send, ) -> Result<(PermissionSubjectState, T), PlayerPermissionUpdateError<E>>
where T: Send, E: Send,

Atomically edits one player’s persisted permission state.

Persistence completes before the cache is published. An online player is refreshed from the latest cached snapshot at the server job tick stage.

§Errors

Returns an edit error, an unknown newly assigned group, or a storage error.

Source

pub async fn replace_permission_groups( self: &Arc<Self>, config: PermissionGroupsConfig, ) -> Result<(), PermissionGroupManagerError>

Replaces the complete permission group config and refreshes online players.

§Errors

Returns an error when validation or persistence fails.

Source

pub async fn update_permission_groups( self: &Arc<Self>, update: impl FnOnce(&mut PermissionGroupsConfig) + Send, ) -> Result<(), PermissionGroupManagerError>

Edits the latest permission group config and refreshes online players.

§Errors

Returns an error when validation or persistence fails.

Source

pub async fn try_update_permission_groups<T, E>( self: &Arc<Self>, update: impl FnOnce(&mut PermissionGroupsConfig) -> Result<T, E> + Send, ) -> Result<T, PermissionGroupUpdateError<E>>
where T: Send, E: Send,

Applies a fallible permission group edit and refreshes online players.

§Errors

Returns the caller edit error or a validation/persistence error.

Source

fn queue_player_permission_refresh(self: &Arc<Self>, uuid: Uuid)

Source

pub(crate) fn refresh_player_permission_state(self: &Arc<Self>, uuid: Uuid)

Source

fn queue_online_permission_group_refresh(self: &Arc<Self>)

Source

fn refresh_online_permission_groups(self: &Arc<Self>)

Source§

impl Server

Source

pub fn queue_player_join(self: &Arc<Self>, player: Arc<Player>)

Queues initial player join work.

Persistent data is loaded asynchronously, then world insertion is finalized at the game tick safe point so the socket reader can enter play immediately.

Source

async fn prepare_player_join( &self, player: &Player, ) -> Result<DomainPlayerState, String>

Source

pub(super) fn process_player_joins(self: &Arc<Self>)

Source

pub(super) fn finish_prepared_player_join( self: &Arc<Self>, join: PendingPlayerJoin, )

Source

pub(super) fn reserve_player_join(&self, player: &Player) -> bool

Source

fn admit_reserved_player(&self, player: Arc<Player>) -> bool

Source

fn reserve_player_disconnect(&self, player: &Arc<Player>) -> bool

Source

pub(super) fn reserve_player_relocation(&self, player: &Arc<Player>) -> bool

Source

fn transition_player_relocation_to_disconnect( &self, player: &Arc<Player>, ) -> bool

Source

pub(super) fn release_player_admission( &self, uuid: Uuid, state: PlayerAdmissionState, )

Source

fn remove_online_player_sync(&self, player: &Arc<Player>)

Source

pub(crate) fn queue_player_disconnect(&self, player: Arc<Player>)

Source

pub(crate) fn queue_detached_player_disconnect( &self, player: Arc<Player>, domain: String, player_data: Arc<PersistentPlayerData>, pending_token: PendingWorldChangeToken, )

Source

pub(crate) fn queue_relocating_player_disconnect( &self, player: Arc<Player>, domain: String, player_data: Arc<PersistentPlayerData>, pending_token: PendingWorldChangeToken, )

Source

pub(super) fn process_player_disconnects(&self) -> Vec<PendingPlayerDisconnect>

Source

pub(super) fn process_player_disconnect( &self, player: Arc<Player>, ) -> Option<PendingPlayerDisconnect>

Source

async fn save_disconnected_player(&self, pending: PendingPlayerDisconnect)

Source

pub(super) fn start_player_disconnect_saves( self: &Arc<Self>, saves: &mut JoinSet<()>, )

Source

pub fn broadcast_to_online<P: ClientPacket>(&self, packet: P)

Broadcasts a packet to every online player, regardless of world membership.

Source

pub(super) fn broadcast_to_online_with<P: ClientPacket, F: Fn(&Player) -> P>( &self, packet: F, )

Source

fn sync_tab_list(&self, player: &Arc<Player>)

Sends full tab list synchronization for a newly joined player.

Server membership mirrors vanilla PlayerList; world entity spawning remains owned by the per-world entity tracker.

Source

pub(super) fn broadcast_player_latency_updates(&self)

Source§

impl Server

Source

pub(super) async fn load_join_domain( &self, player: &Player, ) -> Result<String, String>

Source

pub(super) async fn load_domain_player_state( &self, player: &Player, target_domain: &str, explicit_target_world: Option<Arc<World>>, ) -> Result<DomainPlayerState, String>

Source

pub(super) async fn load_unprepared_domain_player_state( &self, player: &Player, target_domain: &str, explicit_target_world: Option<Arc<World>>, ) -> Result<UnpreparedDomainPlayerState, String>

Source

async fn prepare_domain_player_state( &self, target_domain: &str, state: UnpreparedDomainPlayerState, ) -> Result<DomainPlayerState, String>

Source

async fn prepare_target_spawn( &self, target_domain: &str, explicit_target_world: bool, world: &Arc<World>, ) -> Result<(Arc<World>, PreparedSpawn), String>

Source

async fn prepare_default_spawn( world: &Arc<World>, ) -> Result<PreparedSpawn, String>

Source

async fn prepare_respawn_spawn( world: &Arc<World>, respawn_data: &RespawnData, ) -> Result<PreparedSpawn, String>

Source

fn resolve_saved_world( &self, saved_world: &str, target_domain: &str, explicit_target_world: Option<&Identifier>, player_name: &str, ) -> Option<Arc<World>>

Source

pub(super) fn apply_domain_player_state( player: &Arc<Player>, state: &DomainPlayerState, )

Source

pub(super) fn prepare_domain_restores( &self, player: &Player, state: &DomainPlayerState, ) -> PreparedDomainRestores

Source

pub(super) fn install_domain_restores( player: &Player, residence_token: DomainResidenceToken, restores: &PreparedDomainRestores, ) -> bool

Source

pub(super) fn schedule_domain_restores( &self, player: &Arc<Player>, residence_token: DomainResidenceToken, restores: PreparedDomainRestores, )

Source

pub(super) fn root_vehicle_to_restore( state: &DomainPlayerState, ) -> Option<PersistentRootVehicle>

Source

fn ender_pearls_to_restore( state: &DomainPlayerState, ) -> Vec<PersistentEnderPearl>

Source

pub(super) fn resolve_pearl_world( &self, world_key: &str, expected_domain: &str, player: &Player, ) -> Option<Arc<World>>

Source

pub(super) fn send_login_packet(&self, player: &Player, world: &World)

Source

pub fn get_players(&self) -> Vec<Arc<Player>>

Gets all the players on the server

Source

pub(crate) fn owns_online_player(&self, player: &Player) -> bool

Returns whether this exact player owns the online session for its UUID.

Source

pub(crate) fn live_world_for_player( &self, player: &Player, ) -> Option<Arc<World>>

Returns the world that owns this exact online player.

The player’s stored world pointer intentionally remains unchanged while detached domain data is loading, so live membership must also be present in that world’s player index.

Source

pub(crate) fn command_world_for_player( &self, player: &Player, ) -> Option<Arc<World>>

Returns the live world in which a player may participate in gameplay commands.

A queued domain switch still has source-world membership until the safe point, but gameplay work must stop as soon as that transition owns the player. Finalization is live again and therefore remains available.

Source

pub fn player_count(&self) -> usize

Returns the total number of players currently online across all worlds.

Source

pub fn player_sample(&self) -> Vec<(String, String)>

Returns a sample of up to 12 online players for the server list ping.

Source

pub fn overworld(&self) -> &Arc<World>

Returns the server default world or if not exists the first world.

§Panics

if no world exists on this server crisis is there!

Source

pub fn respawn_world_and_data_for_domain( &self, domain: &str, ) -> Result<(Arc<World>, RespawnData), String>

Resolves the default respawn world and data for a domain.

Source

pub fn respawn_data_for_domain( &self, domain: &str, ) -> Result<RespawnData, String>

Returns the default respawn data sent to clients in the given domain.

Source

pub fn set_respawn_data(&self, respawn_data: RespawnData) -> Result<(), String>

Sets the default respawn data for the respawn data’s domain and broadcasts it.

Source

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

Returns the default domain’s conventional nether world, if present.

Source

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

Returns the default domain’s conventional end world, if present.

Source§

impl Server

Source

pub(super) fn process_world_changes( self: &Arc<Self>, tick_count: u64, runs_normally: bool, )

Source

fn queue_nether_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, portal_pos: BlockPos, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

fn queue_end_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

fn queue_end_entry_portal_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

fn queue_end_portal_player_return_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

fn queue_end_portal_entity_return_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

fn queue_end_gateway_change( self: &Arc<Self>, entity: SharedEntity, source_world: Arc<World>, portal_pos: BlockPos, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

pub(super) fn can_teleport_between_worlds( &self, entity: &dyn Entity, source_world: &World, target_world: &World, ) -> bool

Source

fn projectile_owner_seen_credits_in_domain( &self, domain: &str, uuid: &Uuid, ) -> Option<bool>

Source

fn strict_respawn_world_and_data_for_domain( &self, domain: &str, ) -> Result<(Arc<World>, RespawnData), String>

Source

fn begin_player_relocation( &self, player: &Player, ) -> Result<(Arc<World>, PendingWorldChangeToken), String>

Source

pub fn queue_player_world_selection( &self, player: Arc<Player>, target_world: Arc<World>, ) -> Result<(), String>

Queues a selected loaded world through the player’s relocation lease.

Same-domain selections move to the world’s spawn. Cross-domain selections restore that domain while honoring the explicit target.

Source

pub fn queue_domain_switch( &self, player: Arc<Player>, target_domain: String, ) -> Result<(), String>

Queues a player domain switch for processing at the server tick safe point.

Source

pub(super) fn process_domain_switches(self: &Arc<Self>)

Source

fn start_domain_switch( self: &Arc<Self>, request: DomainSwitchRequest, ) -> Result<(), String>

Source

fn process_player_world_selection( self: &Arc<Self>, entity: SharedEntity, target_world: Arc<World>, pending_token: PendingWorldChangeToken, tick_count: u64, runs_normally: bool, )

Source

pub fn queue_world_change( &self, entity: SharedEntity, request: WorldChangeRequest, )

Queues a world change to be processed after the current tick.

Source§

impl Server

Source

pub(crate) fn permission_rule_suggestions(&self) -> Vec<String>

Source

pub(crate) fn permission_metadata_suggestions(&self) -> Vec<String>

Source

pub async fn new( chunk_runtime: Arc<Runtime>, cancel_token: CancellationToken, config: RuntimeConfig, worlds_config: WorldsConfig, permission_groups: PermissionGroupManager, ) -> Result<Self, String>

Creates a new server with only Steel’s built-in commands.

Source

pub async fn new_with_commands( chunk_runtime: Arc<Runtime>, cancel_token: CancellationToken, config: RuntimeConfig, worlds_config: WorldsConfig, permission_groups: PermissionGroupManager, command_registry: CommandRegistry, ) -> Result<Self, String>

Creates a new server and atomically merges startup command extensions after built-ins.

Source

pub async fn save_command_storage(&self) -> Result<usize>

Saves all dirty domain command storage through domain default worlds.

Source

pub async fn save_command_data(&self) -> CommandDataSaveResults

Saves all command-owned persistent data while allowing each data set to fail independently.

Source

pub fn submit_command( &self, sender: CommandSender, command: String, ) -> Result<(), CommandQueueFull>

Queues a command for execution at the start of the next game tick.

Source

pub(crate) fn submit_command_suggestions( &self, player: Arc<Player>, transaction_id: i32, input: String, ) -> Result<(), CommandQueueFull>

Source

pub(crate) fn schedule_play_packet( &self, player: Arc<Player>, packet: ScheduledPlayPacket, payload_bytes: usize, )

Schedules a decoded play packet for the inter-tick packet phase.

Source

pub fn command_completions( self: &Arc<Self>, sender: CommandSender, input: &str, ) -> Vec<CommandCompletion>

Returns Brigadier completions visible to a command sender.

Auto Trait Implementations§

§

impl !Freeze for Server

§

impl !RefUnwindSafe for Server

§

impl !UnwindSafe for Server

§

impl Send for Server

§

impl Sync for Server

§

impl Unpin for Server

§

impl UnsafeUnpin for Server

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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