Trait gix_object::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 Blob

source§

impl WriteTo for Commit

source§

impl WriteTo for Tag

source§

impl WriteTo for Tree

Serialization

source§

impl<'a> WriteTo for ObjectRef<'a>

Serialization

source§

impl<'a> WriteTo for BlobRef<'a>

source§

impl<'a> WriteTo for CommitRef<'a>

source§

impl<'a> WriteTo for TagRef<'a>

source§

impl<'a> WriteTo for TreeRef<'a>

Serialization