pub struct Client { /* private fields */ }Expand description
A connection to a data server.
Implementations§
Source§impl Client
impl Client
Sourcepub fn connect(host: &Host, policy: &RetryPolicy) -> Result<Self>
pub fn connect(host: &Host, policy: &RetryPolicy) -> Result<Self>
Connects to host.
§Errors
Fails when the name does not resolve to an IPv4 address or the connection fails. The message
names host:port and says to start DayZDiag_x64.exe with -server -startNavmeshDataServer.
Sourcepub fn world_params(&mut self) -> Result<WorldParams>
pub fn world_params(&mut self) -> Result<WorldParams>
Requests the world params. One attempt, no retry.
§Errors
Fails on I/O errors, on an answer that is not message 4 (“expected world params, got message N”) and on a malformed or wrong-version payload.
Sourcepub fn tile(
&mut self,
x: i32,
z: i32,
world: &WorldParams,
) -> Result<TileInput, FetchError>
pub fn tile( &mut self, x: i32, z: i32, world: &WorldParams, ) -> Result<TileInput, FetchError>
Fetches tile (x, z).
A network-class failure closes the connection, waits delay_unit * (attempt + 1) and retries
on a fresh connection; the last allowed attempt’s failure is final (FetchError::Network).
A malformed payload is a FetchError::Wire at once.
§Errors
See above. The answer must carry the requested (x, z) and a cell class that exists in
world.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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