[−][src]Struct binjs::io::entropy::dictionary::DictionaryFamily
A family of dictionaries.
By convention:
- key
""
maps to the starting dictionary; - key
"*"
maps to the fallback dictionary, in which all probabilities are equal.
Methods
impl<T> DictionaryFamily<T>
[src]
pub fn exit(&mut self, name: &SharedString)
[src]
Exit the current dictionary, returning to the parent dictionary.
Failure
Fails if name
is not the name of the current dictionary. Used for assertion
purposes.
pub fn len(&self) -> usize
[src]
Return the sum of lengths of all dictionaries in this family.
impl DictionaryFamily<Instances>
[src]
pub fn new() -> DictionaryFamily<Instances>
[src]
Create an empty DictionaryFamily.
Initially, this DictionaryFamily
does not have a current
dictionary. Before the first call to Self::current
or Self::current_mut
,
clients MUST call either enter_existing
or enter_or_create
to enter a
dictionary.
pub fn enter_or_create(&mut self, name: &SharedString, options: Options)
[src]
Push a dictionary on top of the stack. Create the dictionary if no such dictionary exists.
pub fn current_mut(&mut self) -> &mut Dictionary<Instances>
[src]
Access the current dictionary, mutably.
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut Dictionary<Instances>>
[src]
Iterate mutably through all dictionaries in this family.
pub fn insert_baseline(&mut self, dictionary: Dictionary<Instances>) -> bool
[src]
Manually insert a dictionary in the family.
Returns true
if there was already a baseline dictionary, false
otherwise.
impl DictionaryFamily<SymbolInfo>
[src]
pub fn enter_existing(&mut self, name: &SharedString) -> Result<(), ()>
[src]
pub fn current(&self) -> &Dictionary<SymbolInfo>
[src]
Access the current dictionary, immutably.
Trait Implementations
impl<T> Clone for DictionaryFamily<T> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> DictionaryFamily<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de, T> Deserialize<'de> for DictionaryFamily<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<DictionaryFamily<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<DictionaryFamily<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl InstancesToProbabilities for DictionaryFamily<Instances>
[src]
type AsProbabilities = DictionaryFamily<SymbolInfo>
fn instances_to_probabilities(
&self,
description: &str
) -> DictionaryFamily<SymbolInfo>
[src]
&self,
description: &str
) -> DictionaryFamily<SymbolInfo>
impl<T> Serialize for DictionaryFamily<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl<T> !RefUnwindSafe for DictionaryFamily<T>
impl<T> !Send for DictionaryFamily<T>
impl<T> !Sync for DictionaryFamily<T>
impl<T> Unpin for DictionaryFamily<T>
impl<T> !UnwindSafe for DictionaryFamily<T>
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> 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>,