gix_object

Trait WriteTo

Source
pub trait WriteTo {
    // Required methods
    fn write_to(&self, out: &mut dyn Write) -> Result<()>;
    fn kind(&self) -> Kind;
    fn size(&self) -> u64;

    // Provided method
    fn loose_header(&self) -> SmallVec<[u8; 28]> { ... }
}
Expand description

Writing of objects to a Write implementation

Required Methods§

Source

fn write_to(&self, out: &mut dyn Write) -> Result<()>

Write a representation of this instance to out.

Source

fn kind(&self) -> Kind

Returns the type of this object.

Source

fn size(&self) -> u64

Returns the size of this object’s representation (the amount of data which would be written by write_to).

size’s value has no bearing on the validity of the object, as such it’s possible for size to return a sensible value but write_to to fail because the object was not actually valid in some way.

Provided Methods§

Source

fn loose_header(&self) -> SmallVec<[u8; 28]>

Returns a loose object header based on the object’s data

Implementations on Foreign Types§

Source§

impl<T> WriteTo for &T
where T: WriteTo,

Source§

fn write_to(&self, out: &mut dyn Write) -> Result<()>

Source§

fn kind(&self) -> Kind

Source§

fn size(&self) -> u64

Implementors§

Source§

impl WriteTo for Object

Serialization

Source§

impl WriteTo for ObjectRef<'_>

Serialization

Source§

impl WriteTo for Blob

Source§

impl WriteTo for BlobRef<'_>

Source§

impl WriteTo for Commit

Source§

impl WriteTo for CommitRef<'_>

Source§

impl WriteTo for Tag

Source§

impl WriteTo for TagRef<'_>

Source§

impl WriteTo for Tree

Serialization

Source§

impl WriteTo for TreeRef<'_>

Serialization