pub struct ConnectionConfig { /* private fields */ }
Expand description
Builder for a Minecraft ServerListPing connection.
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn build<T: Into<String>>(address: T) -> Self
pub fn build<T: Into<String>>(address: T) -> Self
Initiates the Minecraft server connection build process.
Sourcepub fn with_protocol_version(self, protocol_version: usize) -> Self
pub fn with_protocol_version(self, protocol_version: usize) -> Self
Sets a specific protocol version for the connection to use. If not specified, the latest version will be used.
Sourcepub fn with_port(self, port: u16) -> Self
pub fn with_port(self, port: u16) -> Self
Sets a specific port for the connection to use. If not specified, the default port of 25565 will be used.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets a specific timeout for the connection to use. If not specified, the timeout defaults to two seconds.
Sourcepub async fn connect(self) -> Result<StatusConnection, ServerError>
pub async fn connect(self) -> Result<StatusConnection, ServerError>
Connects to the server and consumes the builder.
Auto Trait Implementations§
impl Freeze for ConnectionConfig
impl RefUnwindSafe for ConnectionConfig
impl Send for ConnectionConfig
impl Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl UnwindSafe for ConnectionConfig
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