[−][src]Struct tantivy::directory::ReadOnlySource
Read object that represents files in tantivy.
These read objects are only in charge to deliver
the data in the form of a constant read-only &[u8]
.
Whatever happens to the directory file, the data
hold by this object should never be altered or destroyed.
Methods
impl ReadOnlySource
[src]
pub fn empty() -> ReadOnlySource
[src]
Creates an empty ReadOnlySource
pub fn as_slice(&self) -> &[u8]
[src]
Returns the data underlying the ReadOnlySource object.
pub fn split(self, addr: usize) -> (ReadOnlySource, ReadOnlySource)
[src]
Splits into 2 ReadOnlySource
, at the offset given
as an argument.
pub fn split_from_end(
self,
right_len: usize
) -> (ReadOnlySource, ReadOnlySource)
[src]
self,
right_len: usize
) -> (ReadOnlySource, ReadOnlySource)
Splits into 2 ReadOnlySource
, at the offset end - right_len
.
pub fn slice(&self, start: usize, stop: usize) -> ReadOnlySource
[src]
Creates a ReadOnlySource that is just a view over a slice of the data.
Keep in mind that any living slice extends the lifetime of the original ReadOnlySource,
For instance, if ReadOnlySource
wraps 500MB
worth of data in anonymous memory, and only a
1KB slice is remaining, the whole 500MBs
are retained in memory.
pub fn slice_from(&self, from_offset: usize) -> ReadOnlySource
[src]
Like .slice(...)
but enforcing only the from
boundary.
Equivalent to .slice(from_offset, self.len())
pub fn slice_to(&self, to_offset: usize) -> ReadOnlySource
[src]
Like .slice(...)
but enforcing only the to
boundary.
Equivalent to .slice(0, to_offset)
Trait Implementations
impl Clone for ReadOnlySource
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl CloneStableDeref for ReadOnlySource
[src]
impl Deref for ReadOnlySource
[src]
impl From<Arc<Box<dyn Deref<Target = [u8]> + 'static + Sync + Send>>> for ReadOnlySource
[src]
impl From<Vec<u8>> for ReadOnlySource
[src]
fn from(data: Vec<u8>) -> ReadOnlySource
[src]
impl HasLen for ReadOnlySource
[src]
impl StableDeref for ReadOnlySource
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ReadOnlySource
impl Send for ReadOnlySource
impl Sync for ReadOnlySource
impl Unpin for ReadOnlySource
impl !UnwindSafe for ReadOnlySource
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> 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,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
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> 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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,