pub struct ProtocolNbtAdapter {
pub encoding: ProtocolNbtEncoding,
pub read_config: NbtReadConfig,
}Fields§
§encoding: ProtocolNbtEncoding§read_config: NbtReadConfigImplementations§
Source§impl ProtocolNbtAdapter
impl ProtocolNbtAdapter
pub fn network() -> Self
pub fn little_endian() -> Self
pub fn big_endian() -> Self
pub fn with_config(self, read_config: NbtReadConfig) -> Self
pub fn with_limits(self, limits: NbtLimits) -> Self
pub fn with_parse_mode(self, parse_mode: ParseMode) -> Self
pub fn decode_headless_tag( &self, tag_type: TagType, bytes: &[u8], ) -> Result<Tag>
pub fn decode_headless<T: DeserializeOwned>( &self, tag_type: TagType, bytes: &[u8], ) -> Result<T>
pub fn encode_headless_tag(&self, tag: &Tag) -> Result<Vec<u8>>
pub fn encode_headless<T: Serialize>( &self, value: &T, ) -> Result<(TagType, Vec<u8>)>
pub fn decode_prefixed_tag(&self, bytes: &[u8]) -> Result<Tag>
pub fn decode_prefixed<T: DeserializeOwned>(&self, bytes: &[u8]) -> Result<T>
pub fn encode_prefixed_tag(&self, tag: &Tag) -> Result<Vec<u8>>
pub fn encode_prefixed<T: Serialize>(&self, value: &T) -> Result<Vec<u8>>
pub fn decode_root_tag(&self, bytes: &[u8]) -> Result<RootTag>
pub fn decode_root<T: DeserializeOwned>(&self, bytes: &[u8]) -> Result<T>
pub fn decode_root_named<T: DeserializeOwned>( &self, bytes: &[u8], ) -> Result<(String, T)>
pub fn encode_root_tag(&self, root: &RootTag) -> Result<Vec<u8>>
pub fn encode_root<T: Serialize>( &self, root_name: impl Into<String>, value: &T, ) -> Result<Vec<u8>>
Trait Implementations§
Source§impl Clone for ProtocolNbtAdapter
impl Clone for ProtocolNbtAdapter
Source§fn clone(&self) -> ProtocolNbtAdapter
fn clone(&self) -> ProtocolNbtAdapter
Returns a duplicate 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 moreSource§impl Debug for ProtocolNbtAdapter
impl Debug for ProtocolNbtAdapter
Source§impl Default for ProtocolNbtAdapter
impl Default for ProtocolNbtAdapter
Source§impl PartialEq for ProtocolNbtAdapter
impl PartialEq for ProtocolNbtAdapter
impl Eq for ProtocolNbtAdapter
impl StructuralPartialEq for ProtocolNbtAdapter
Auto Trait Implementations§
impl Freeze for ProtocolNbtAdapter
impl RefUnwindSafe for ProtocolNbtAdapter
impl Send for ProtocolNbtAdapter
impl Sync for ProtocolNbtAdapter
impl Unpin for ProtocolNbtAdapter
impl UnsafeUnpin for ProtocolNbtAdapter
impl UnwindSafe for ProtocolNbtAdapter
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.