pub struct ServerConnection { /* private fields */ }
Expand description
Stores all information necessary to talk to the server. Notably, if you
clone this, instead of creating this multiple times for characters on a
server, this will use the same reqwest::Client
, which can have slight
benefits to performance
Implementations§
Source§impl ServerConnection
impl ServerConnection
Sourcepub fn new(server_url: &str) -> Option<ServerConnection>
pub fn new(server_url: &str) -> Option<ServerConnection>
Creates a new server instance. This basically just makes sure the URL is valid and otherwise tries to make it valid
Sourcepub fn new_with_options(
server_url: &str,
options: ConnectionOptions,
) -> Option<ServerConnection>
pub fn new_with_options( server_url: &str, options: ConnectionOptions, ) -> Option<ServerConnection>
Creates a new server instance with the options provided. This basically just makes sure the URL is valid and otherwise tries to make it valid
Trait Implementations§
Source§impl Clone for ServerConnection
impl Clone for ServerConnection
Source§fn clone(&self) -> ServerConnection
fn clone(&self) -> ServerConnection
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ServerConnection
impl !RefUnwindSafe for ServerConnection
impl Send for ServerConnection
impl Sync for ServerConnection
impl Unpin for ServerConnection
impl !UnwindSafe for ServerConnection
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