pub struct Server {
pub name: String,
pub ip: String,
pub accept_textures: AcceptTextures,
pub path: PathBuf,
}Available on crate feature
servers only.Expand description
Represents a single server.
Fields§
§name: StringName of the server.
ip: StringIP address of the server.
accept_textures: AcceptTexturesWhether the user accepted server resource packs.
path: PathBufPath of the servers.dat file.
Implementations§
Source§impl Server
impl Server
Sourcepub async fn add(server: Self) -> CobbleResult<()>
pub async fn add(server: Self) -> CobbleResult<()>
Adds a server to the servers.dat file.
Sourcepub async fn remove(self) -> CobbleResult<()>
pub async fn remove(self) -> CobbleResult<()>
Removes the server from its servers.dat file.
Sourcepub async fn decode_icon(&self) -> CobbleResult<Option<Vec<u8>>>
pub async fn decode_icon(&self) -> CobbleResult<Option<Vec<u8>>>
Loads the server icon and decodes it into PNG bytes.
Sourcepub fn load_base64_icon(&self) -> CobbleResult<Option<String>>
pub fn load_base64_icon(&self) -> CobbleResult<Option<String>>
Loads the server icon as a base64 string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.