pub enum Content {
Object(Value),
Block(Vec<u8>),
}
Expand description
The content read from a stream.
Either an object or raw primitive data. Also used to represent class and object annotations for custom write methods
This is the top level type that clients will interact with. When Java code writes to a stream it can choose to write
-
objects, which will each be read into an instance of Object (containing its data)
-
primitives, which are written as bytes and returned as instances of Block (containing the data).
The individual java primitives are not distinguished in the stream so that writing
(short)1
twice and writing(int)65537
once result in the same stream being wrtten. For this reason, decoding the bytes read is left to the client code that hopefully knows what format to expect.
Variants§
Implementations§
Trait Implementations§
impl StructuralPartialEq for Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnwindSafe for Content
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