pub struct ServerStatus {
pub online: bool,
pub ip: String,
pub port: u16,
pub hostname: String,
pub latency: f64,
pub dns: Option<DnsInfo>,
pub data: ServerData,
pub cached: bool,
pub meta: HashMap<String, String>,
}Expand description
Full server status returned to callers after a successful ping.
Assembled by McClient from a PingResult (produced
by the wire protocol) plus resolved network metadata (IP, port, DNS info).
Most callers access this through the typed wrappers
JavaServerStatus and
BedrockServerStatus which provide
ergonomic accessors. Use .raw() on those wrappers or match on
ServerData directly when you need fields not surfaced by the accessors.
§Serde
ServerStatus implements Serialize and Deserialize.
The meta field is skipped in serialisation when empty.
Fields§
§online: booltrue if the server responded successfully within the timeout.
ip: StringResolved IP address of the server, e.g. "172.65.197.160".
port: u16Port that was connected to.
hostname: StringOriginal hostname as provided to the ping call, e.g. "mc.hypixel.net".
This is the value sent in the Minecraft handshake packet.
latency: f64Round-trip latency in milliseconds. 0.0 for cached responses.
dns: Option<DnsInfo>DNS resolution metadata. None only in unusual error paths.
data: ServerDataEdition-specific payload — match on ServerData to access fields.
cached: booltrue when this result was served from the response cache without
a network request. latency will be 0.0 in this case.
Prefer JavaServerStatus::is_cached
or BedrockServerStatus::is_cached
over accessing this field directly.
meta: HashMap<String, String>Protocol-specific extra fields forwarded from PingResult::meta.
Empty for Java Modern and Bedrock (they have fully-typed models). Skipped in serialisation when empty.
Implementations§
Trait Implementations§
Source§impl Clone for ServerStatus
impl Clone for ServerStatus
Source§fn clone(&self) -> ServerStatus
fn clone(&self) -> ServerStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerStatus
impl Debug for ServerStatus
Source§impl<'de> Deserialize<'de> for ServerStatus
impl<'de> Deserialize<'de> for ServerStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ServerStatus
impl RefUnwindSafe for ServerStatus
impl Send for ServerStatus
impl Sync for ServerStatus
impl Unpin for ServerStatus
impl UnsafeUnpin for ServerStatus
impl UnwindSafe for ServerStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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