[][src]Struct tantivy::schema::Facet

pub struct 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]

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]

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]

impl PartialEq<Facet> for Facet[src]

impl PartialOrd<Facet> for Facet[src]

impl Display for Facet[src]

impl Debug for Facet[src]

impl Hash for Facet[src]

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]

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]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]