pub enum AtomData {
UTF8(String),
UTF16(String),
Picture(Picture),
SignedInteger(i32),
UnsignedInteger(u32),
Bool(bool),
Unknown {
code: u32,
data: Vec<u8>,
},
}
Expand description
The data of an atom
NOTES:
- This only covers the most common data types. See the list of well-known data types for codes.
- There are only two variants for integers, which
will come from codes
21
and22
. All other integer types will be stored asAtomData::Unknown
, refer to the link above for codes.
Variants§
UTF8(String)
A UTF-8 encoded string
UTF16(String)
A UTF-16 encoded string
Picture(Picture)
A JPEG, PNG, GIF (Deprecated), or BMP image
The type is read from the picture itself
SignedInteger(i32)
A big endian signed integer (1-4 bytes)
NOTE:
This will shrink the integer when writing
255 will be written as [255]
rather than [0, 0, 0, 255]
This behavior may be unexpected, use AtomData::Unknown
if unsure
UnsignedInteger(u32)
A big endian unsigned integer (1-4 bytes)
NOTE: See AtomData::SignedInteger
Bool(bool)
A boolean value
NOTE: This isn’t an official data type, but multiple flag atoms exist,
so this makes them easier to represent. The real underlying type
is SignedInteger
.
Unknown
Unknown data
Due to the number of possible types, there are many specified types that are going to fall into this variant.
Trait Implementations§
source§impl PartialEq for AtomData
impl PartialEq for AtomData
impl Eq for AtomData
impl StructuralPartialEq for AtomData
Auto Trait Implementations§
impl Freeze for AtomData
impl RefUnwindSafe for AtomData
impl Send for AtomData
impl Sync for AtomData
impl Unpin for AtomData
impl UnwindSafe for AtomData
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