[−][src]Struct binjs_io::entropy::dictionary::LinearTable
A data structure designed to cache information accessible either by index or by value.
Methods
impl<T> LinearTable<T> where
T: Eq + Hash + Clone,
[src]
T: Eq + Hash + Clone,
pub fn shared_len(&self) -> usize
[src]
The number of values representing shared dictionary entries in this table.
pub fn prelude_len(&self) -> usize
[src]
The number of values representing prelude dictionary entries in this table.
pub fn len(&self) -> usize
[src]
The number of values in this table.
impl<T> LinearTable<T> where
T: Eq + Hash + Clone + Debug + Ord,
[src]
T: Eq + Hash + Clone + Debug + Ord,
pub fn new(
value_to_instances: HashMap<T, FilesContaining>,
threshold: FilesContaining
) -> Self
[src]
value_to_instances: HashMap<T, FilesContaining>,
threshold: FilesContaining
) -> Self
Create a new LinearTable from a list of instances.
Values appearing in instances
that have threshold
instances or less are ignored.
pub fn with_capacity(len: usize) -> Self
[src]
Create an empty LinearTable
.
pub fn fetch_index(&mut self, value: &T) -> Fetch<TableRef>
[src]
Attempt to get the index for a value from the LinearTable
.
If the value is already in the cache, return Fetch::Hit(index)
, where index
is the
immutable index of the value. Otherwise, allocate a new slot index
and return
Fetch::Miss(index)
.
In both Fetch::Hit(index)
and Fetch::Miss(index)
, 0
is the first value, 1
the second
value, etc.
pub fn with_prelude<'a>(&self, prelude: &'a [T]) -> Result<Self, &'a T>
[src]
Create a copy of the current LinearTable with an added prelude dictionary.
pub fn at_index(&self, table_ref: &TableRef) -> Option<&T>
[src]
Access the contents of this table by index.
Trait Implementations
impl<T: Clone> Clone for LinearTable<T> where
T: Eq + Hash + Clone,
[src]
T: Eq + Hash + Clone,
fn clone(&self) -> LinearTable<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for LinearTable<T> where
T: Eq + Hash + Clone,
[src]
T: Eq + Hash + Clone,
impl<'de, T> Deserialize<'de> for LinearTable<T> where
T: Eq + Hash + Clone,
T: Deserialize<'de>,
[src]
T: Eq + Hash + Clone,
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T> Serialize for LinearTable<T> where
T: Eq + Hash + Clone,
T: Serialize,
[src]
T: Eq + Hash + Clone,
T: Serialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for LinearTable<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for LinearTable<T> where
T: Send,
T: Send,
impl<T> Sync for LinearTable<T> where
T: Sync,
T: Sync,
impl<T> Unpin for LinearTable<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for LinearTable<T> where
T: UnwindSafe,
T: UnwindSafe,
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
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> From<T> for T
[src]
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>,
[src]
V: MultiLane<T>,