[][src]Enum mcquery::Query

pub enum Query {
    Basic(BasicQueryResponse),
    Full(FullQueryResponse),
}

The main data structure in this crate

Description

Basic queries are enabled by default. They can be diabled in the server's server.properties with enable-status=true. This is what is used in the server list inside Minecraft.

Full queries are diabled by default. They can be enabled in the server's server.properties with enable-query=true.

Variants

Basic(BasicQueryResponse)

Response to a basic query. Can be obtained with Query::get_basic()

See BasicQueryResponse for more

Full(FullQueryResponse)

Response to a full query. Can be obtained with Query::get_full()

See FullQueryResponse for more

Implementations

impl Query[src]

pub async fn get_basic<A: ToSocketAddrs, '_>(
    address: A,
    timeout: Duration,
    buffer: &'_ mut [u8]
) -> Result<Self>
[src]

Connects with the Minecraft server at address and performs a basic query. timeout is used as a response timeout. The specified buffer needs to be big enough to hold all response bytes, else this function will return a MaybeIncompleteDataError wrapped in an std::io::Error. The Ok value will be Query::Basic.

pub async fn get_full<A: ToSocketAddrs, '_>(
    address: A,
    timeout: Duration,
    buffer: &'_ mut [u8]
) -> Result<Self>
[src]

Connects with the Minecraft server at address and performs a full query. timeout is used as a response timeout. The specified buffer needs to be big enough to hold all response bytes, else this function will return a MaybeIncompleteDataError wrapped in an std::io::Error. The Ok vlaue will be Query::Full.

Trait Implementations

impl Clone for Query[src]

impl Debug for Query[src]

impl Eq for Query[src]

impl PartialEq<Query> for Query[src]

impl StructuralEq for Query[src]

impl StructuralPartialEq for Query[src]

Auto Trait Implementations

impl RefUnwindSafe for Query

impl Send for Query

impl Sync for Query

impl Unpin for Query

impl UnwindSafe for Query

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.