pub struct SegmentId(_);
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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for SegmentId
impl<'de> Deserialize<'de> for SegmentId
sourcefn 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
sourceimpl Hash for SegmentId
impl Hash for SegmentId
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [
Hasher
]. Read more1.3.0fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
Feeds a slice of this type into the given [
Hasher
]. Read moresourceimpl Ord for SegmentId
impl Ord for SegmentId
sourceimpl PartialOrd<SegmentId> for SegmentId
impl PartialOrd<SegmentId> for SegmentId
impl Copy for SegmentId
impl Eq for SegmentId
impl StructuralEq for SegmentId
impl StructuralPartialEq for SegmentId
Auto Trait Implementations
impl RefUnwindSafe for SegmentId
impl Send for SegmentId
impl Sync for SegmentId
impl Unpin for SegmentId
impl UnwindSafe for SegmentId
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn 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. Read moresourcefn 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. Read moresourceimpl<T> DowncastSync for Twhere
T: Any + Send + Sync,
impl<T> DowncastSync for Twhere
T: Any + Send + Sync,
sourcefn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
Convert
Arc<Trait>
(where Trait: Downcast
) to Arc<Any>
. Arc<Any>
can then be
further downcast
into Arc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourceimpl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more