mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-04 16:22:55 +00:00
* Switch from error-chain to failure crate * Added deprecated alias for * Started editing the changeld
26 lines
851 B
Rust
26 lines
851 B
Rust
use schema::FieldEntry;
|
|
use std::result;
|
|
|
|
/// `FastFieldNotAvailableError` is returned when the
|
|
/// user requested for a fast field reader, and the field was not
|
|
/// defined in the schema as a fast field.
|
|
#[derive(Debug, Fail)]
|
|
#[fail(display = "field not available: '{:?}'", field_name)]
|
|
pub struct FastFieldNotAvailableError {
|
|
field_name: String,
|
|
}
|
|
|
|
impl FastFieldNotAvailableError {
|
|
/// Creates a `FastFieldNotAvailable` error.
|
|
/// `field_entry` is the configuration of the field
|
|
/// for which fast fields are not available.
|
|
pub fn new(field_entry: &FieldEntry) -> FastFieldNotAvailableError {
|
|
FastFieldNotAvailableError {
|
|
field_name: field_entry.name().to_string(),
|
|
}
|
|
}
|
|
}
|
|
|
|
/// Result when trying to access a fast field reader.
|
|
pub type Result<R> = result::Result<R, FastFieldNotAvailableError>;
|