pub enum Server {
Local,
MainAuth(String),
}Expand description
Represents a server or host where user accounts are stored.
Local is a special case for local-only accounts, while MainAuth is for accounts managed by the main authentication server.
Variants§
Implementations§
Source§impl Server
impl Server
Sourcepub fn from_string(s: &str) -> Self
pub fn from_string(s: &str) -> Self
Create a new Server from a string.
If the string is "local", it returns Server::Local.
Otherwise, it returns Server::MainAuth with the string as the host.
Sourcepub fn get_host(&self) -> &str
pub fn get_host(&self) -> &str
Get the server’s host string.
Returns the host string if this is Server::MainAuth, otherwise returns "local" for Server::Local.
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Check if this server is the local one.
Returns true if this is Server::Local, otherwise false.
Sourcepub fn get_address(&self) -> String
pub fn get_address(&self) -> String
Get the actual address of the server.
Trait Implementations§
impl Eq for Server
impl StructuralPartialEq for Server
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ParamValue for T
impl<T> ParamValue for T
Source§fn clone_box(&self) -> Box<dyn ParamValue>
fn clone_box(&self) -> Box<dyn ParamValue>
Clones this value and returns it as a boxed
ParamValue. Read moreSource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying value as
Any. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to the underlying value as
Any. Read more