[−][src]Struct tantivy::schema::Facet
A Facet represent a point in a given hierarchy.
They are typically represented similarly to a filepath.
For instance, an e-commerce website could
have a Facet
for /electronics/tv_and_video/led_tv
.
A document can be associated to any number of facets.
The hierarchy implicitely imply that a document
belonging to a facet also belongs to the ancestor of
its facet. In the example above, /electronics/tv_and_video/
and /electronics
.
Methods
impl Facet
[src]
pub fn root() -> Facet
[src]
Returns a new instance of the "root facet"
Equivalent to /
.
pub fn is_root(&self) -> bool
[src]
Returns true iff the facet is the root facet /
.
pub fn encoded_str(&self) -> &str
[src]
Returns a binary representation of the facet.
In this representation, 0u8
is used as a separator
and the string parts of the facet are unescaped.
(The first /
is not encoded at all).
This representation has the benefit of making it possible to express "being a child of a given facet" as a range over the term ordinals.
pub fn from_encoded(encoded_bytes: Vec<u8>) -> Result<Facet, FromUtf8Error>
[src]
Creates a Facet
from its binary representation.
pub fn from_text<T: ?Sized>(path: &T) -> Facet where
T: AsRef<str>,
[src]
T: AsRef<str>,
Parse a text representation of a facet.
It is conceptually, if one of the steps of this path
contains a /
or a \
, it should be escaped
using an anti-slash /
.
pub fn from_path<Path>(path: Path) -> Facet where
Path: IntoIterator,
Path::Item: ToString,
[src]
Path: IntoIterator,
Path::Item: ToString,
Returns a Facet
from an iterator over the different
steps of the facet path.
The steps are expected to be unescaped.
pub fn is_prefix_of(&self, other: &Facet) -> bool
[src]
Returns true
iff other is a subfacet of self
.
pub fn to_path(&self) -> Vec<&str>
[src]
Extract path from the Facet
.
Trait Implementations
impl<'a, T: ?Sized + AsRef<str>> From<&'a T> for Facet
[src]
impl<'a> From<Facet> for Value
[src]
impl Clone for Facet
[src]
impl Eq for Facet
[src]
impl Ord for Facet
[src]
fn cmp(&self, other: &Facet) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Facet> for Facet
[src]
impl PartialOrd<Facet> for Facet
[src]
fn partial_cmp(&self, other: &Facet) -> Option<Ordering>
[src]
fn lt(&self, other: &Facet) -> bool
[src]
fn le(&self, other: &Facet) -> bool
[src]
fn gt(&self, other: &Facet) -> bool
[src]
fn ge(&self, other: &Facet) -> bool
[src]
impl Display for Facet
[src]
impl Debug for Facet
[src]
impl Hash for Facet
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl StructuralPartialEq for Facet
[src]
impl StructuralEq for Facet
[src]
impl Borrow<str> for Facet
[src]
impl Serialize for Facet
[src]
impl<'de> Deserialize<'de> for Facet
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Facet
impl Sync for Facet
impl Unpin for Facet
impl UnwindSafe for Facet
impl RefUnwindSafe for Facet
Blanket Implementations
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,