pub struct SegmentId(/* private fields */);
Expand description
Uuid identifying a segment.
Tantivy’s segment are identified by a UUID which is used to prefix the filenames of all of the file associated with the segment.
In unit test, for reproducibility, the SegmentId
are
simply generated in an autoincrement fashion.
Implementations§
source§impl SegmentId
impl SegmentId
sourcepub fn short_uuid_string(&self) -> String
pub fn short_uuid_string(&self) -> String
Returns a shorter identifier of the segment.
We are using UUID4, so only 6 bits are fixed, and the rest is random.
Picking the first 8 chars is ok to identify segments in a display message (e.g. a5c4dfcb).
sourcepub fn uuid_string(&self) -> String
pub fn uuid_string(&self) -> String
Returns a segment uuid string.
It consists in 32 lowercase hexadecimal chars (e.g. a5c4dfcbdfe645089129e308e26d5523)
sourcepub fn from_uuid_string(
uuid_string: &str
) -> Result<SegmentId, SegmentIdParseError>
pub fn from_uuid_string( uuid_string: &str ) -> Result<SegmentId, SegmentIdParseError>
Build a SegmentId
string from the full uuid string.
E.g. “a5c4dfcbdfe645089129e308e26d5523”
Trait Implementations§
source§impl<'de> Deserialize<'de> for SegmentId
impl<'de> Deserialize<'de> for SegmentId
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for SegmentId
impl Ord for SegmentId
source§impl PartialEq for SegmentId
impl PartialEq for SegmentId
source§impl PartialOrd for SegmentId
impl PartialOrd for SegmentId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for SegmentId
impl Eq for SegmentId
impl StructuralPartialEq for SegmentId
Auto Trait Implementations§
impl Freeze for SegmentId
impl RefUnwindSafe for SegmentId
impl Send for SegmentId
impl Sync for SegmentId
impl Unpin for SegmentId
impl UnwindSafe for SegmentId
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.