[−][src]Struct rustfst::Tr
Structure representing a transition from a state to another state in a FST.
Fields
ilabel: Label
Input label.
olabel: Label
Output label.
weight: W
Weight.
nextstate: StateId
ID of the next state.
Implementations
impl<W> Tr<W>
[src]
pub fn new<S: Into<W>>(
ilabel: Label,
olabel: Label,
weight: S,
nextstate: StateId
) -> Self
[src]
ilabel: Label,
olabel: Label,
weight: S,
nextstate: StateId
) -> Self
Creates a new Tr.
Example
let transition = Tr::<TropicalWeight>::new(0, 1, 1.3, 2); assert_eq!(transition.ilabel, 0); assert_eq!(transition.olabel, 1); assert_eq!(transition.weight, TropicalWeight::new(1.3)); assert_eq!(transition.nextstate, 2);
pub fn set_value(&mut self, tr: &Tr<W>) where
W: Clone,
[src]
W: Clone,
Updates the values of the attributes of the Tr from another Tr.
Example
let mut tr_1 = Tr::<TropicalWeight>::new(0, 1, 1.3, 2); let tr_2 = Tr::new(1, 2, 1.2, 3); tr_1.set_value(&tr_2); assert_eq!(tr_1, tr_2);
impl<W: SerializableSemiring> Tr<W>
[src]
Trait Implementations
impl<W: Clone> Clone for Tr<W>
[src]
impl<W: Debug> Debug for Tr<W>
[src]
impl<W: Eq> Eq for Tr<W>
[src]
impl<W: Hash> Hash for Tr<W>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<W: PartialEq> PartialEq<Tr<W>> for Tr<W>
[src]
impl<W: PartialOrd> PartialOrd<Tr<W>> for Tr<W>
[src]
fn partial_cmp(&self, other: &Tr<W>) -> Option<Ordering>
[src]
fn lt(&self, other: &Tr<W>) -> bool
[src]
fn le(&self, other: &Tr<W>) -> bool
[src]
fn gt(&self, other: &Tr<W>) -> bool
[src]
fn ge(&self, other: &Tr<W>) -> bool
[src]
impl<W> StructuralEq for Tr<W>
[src]
impl<W> StructuralPartialEq for Tr<W>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for Tr<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for Tr<W> where
W: Send,
W: Send,
impl<W> Sync for Tr<W> where
W: Sync,
W: Sync,
impl<W> Unpin for Tr<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for Tr<W> where
W: UnwindSafe,
W: 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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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>,