Struct fst::raw::Output [−][src]
pub struct Output(_);
An output is a value that is associated with a key in a finite state transducer.
Note that outputs must satisfy an algebra. Namely, it must have an additive
identity and the following binary operations defined: prefix,
concatenation and subtraction. prefix and concatenation are
commutative while subtraction is not. subtraction is only defined on
pairs of operands where the first operand is greater than or equal to the
second operand.
Currently, output values must be u64. However, in theory, an output value
can be anything that satisfies the above algebra. Future versions of this
crate may make outputs generic on this algebra.
Methods
impl Output[src]
impl Outputpub fn new(v: u64) -> Output[src]
pub fn new(v: u64) -> OutputCreate a new output from a u64.
pub fn zero() -> Output[src]
pub fn zero() -> OutputCreate a zero output.
pub fn value(self) -> u64[src]
pub fn value(self) -> u64Retrieve the value inside this output.
pub fn is_zero(self) -> bool[src]
pub fn is_zero(self) -> boolReturns true if this is a zero output.
pub fn prefix(self, o: Output) -> Output[src]
pub fn prefix(self, o: Output) -> OutputReturns the prefix of this output and o.
pub fn cat(self, o: Output) -> Output[src]
pub fn cat(self, o: Output) -> OutputReturns the concatenation of this output and o.
pub fn sub(self, o: Output) -> Output[src]
pub fn sub(self, o: Output) -> OutputReturns the subtraction of o from this output.
This function panics if self > o.
Trait Implementations
impl Copy for Output[src]
impl Copy for Outputimpl Clone for Output[src]
impl Clone for Outputfn clone(&self) -> Output[src]
fn clone(&self) -> OutputReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Output[src]
impl Debug for Outputfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for Output[src]
impl Hash for Outputfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Eq for Output[src]
impl Eq for Outputimpl Ord for Output[src]
impl Ord for Outputfn cmp(&self, other: &Output) -> Ordering[src]
fn cmp(&self, other: &Output) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialEq for Output[src]
impl PartialEq for Outputfn eq(&self, other: &Output) -> bool[src]
fn eq(&self, other: &Output) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Output) -> bool[src]
fn ne(&self, other: &Output) -> boolThis method tests for !=.
impl PartialOrd for Output[src]
impl PartialOrd for Outputfn partial_cmp(&self, other: &Output) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Output) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Output) -> bool[src]
fn lt(&self, other: &Output) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Output) -> bool[src]
fn le(&self, other: &Output) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Output) -> bool[src]
fn gt(&self, other: &Output) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Output) -> bool[src]
fn ge(&self, other: &Output) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more