Struct cobble_core::minecraft::Server
source · 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: String
Name of the server.
ip: String
IP address of the server.
accept_textures: AcceptTextures
Whether the user accepted server resource packs.
path: PathBuf
Path 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 StructuralEq for Server
impl StructuralPartialEq for Server
Auto Trait Implementations§
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.