Struct jujutsu_lib::index::HexPrefix
source · pub struct HexPrefix { /* private fields */ }
Implementations§
source§impl HexPrefix
impl HexPrefix
pub fn new(prefix: &str) -> Option<HexPrefix>
pub fn from_bytes(bytes: &[u8]) -> Self
pub fn hex(&self) -> String
sourcepub fn min_prefix_bytes(&self) -> &[u8] ⓘ
pub fn min_prefix_bytes(&self) -> &[u8] ⓘ
Minimum bytes that would match this prefix. (e.g. “abc0” for “abc”)
Use this to partition a sorted slice, and test matches(id)
from there.
pub fn matches<Q: ObjectId>(&self, id: &Q) -> bool
Trait Implementations§
source§impl PartialEq<HexPrefix> for HexPrefix
impl PartialEq<HexPrefix> for HexPrefix
impl Eq for HexPrefix
impl StructuralEq for HexPrefix
impl StructuralPartialEq for HexPrefix
Auto Trait Implementations§
impl RefUnwindSafe for HexPrefix
impl Send for HexPrefix
impl Sync for HexPrefix
impl Unpin for HexPrefix
impl UnwindSafe for HexPrefix
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more