pub trait PdfObjectTrait: Display {
// Required methods
fn size_in_bytes(&self) -> usize;
fn copy_bytes_into(&self, buffer: &mut [u8], offset: usize) -> usize;
// Provided method
fn to_bytes(&self) -> Vec<u8> ⓘ { ... }
}Expand description
Trait implemented by all PDF object types. Provides serialization to PDF byte format.
Required Methods§
Sourcefn size_in_bytes(&self) -> usize
fn size_in_bytes(&self) -> usize
Return the size in bytes when serialized.
Sourcefn copy_bytes_into(&self, buffer: &mut [u8], offset: usize) -> usize
fn copy_bytes_into(&self, buffer: &mut [u8], offset: usize) -> usize
Copy serialized bytes into the buffer at the given offset. Returns the number of bytes written.