pub trait ObjectTrait:
Send
+ Sync
+ Display {
// Required methods
fn from_bytes(data: &[u8], hash: ObjectHash) -> Result<Self, GitError>
where Self: Sized;
fn get_type(&self) -> ObjectType;
fn get_size(&self) -> usize;
fn to_data(&self) -> Result<Vec<u8>, GitError>;
// Provided method
fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Self
where Self: Sized { ... }
}Required Methods§
Sourcefn from_bytes(data: &[u8], hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
fn from_bytes(data: &[u8], hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
Creates a new object from a byte slice.
Sourcefn get_type(&self) -> ObjectType
fn get_type(&self) -> ObjectType
Returns the type of the object.