Skip to main content

ObjectId

Trait ObjectId 

Source
pub trait ObjectId {
    // Required methods
    fn object_type(&self) -> String;
    fn as_bytes(&self) -> &[u8] ;
    fn to_bytes(&self) -> Vec<u8> ;
    fn hex(&self) -> String;
}
Expand description

An identifier for an object, such as a commit or a tree, usually the output of a hash function.

Required Methods§

Source

fn object_type(&self) -> String

A lowercase name identifying the type of object (e.g. “commit”).

Source

fn as_bytes(&self) -> &[u8]

The identifier as a byte slice.

Source

fn to_bytes(&self) -> Vec<u8>

The identifier as an owned byte vector.

Source

fn hex(&self) -> String

String representation of the identifier using hex digits.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§