pub struct Tr<W> {
pub ilabel: Label,
pub olabel: Label,
pub weight: W,
pub nextstate: StateId,
}
Expand description
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§
source§impl<W> Tr<W>
impl<W> Tr<W>
sourcepub fn new<S: Into<W>>(
ilabel: Label,
olabel: Label,
weight: S,
nextstate: StateId
) -> Self
pub fn new<S: Into<W>>( 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);
Trait Implementations§
source§impl<W: PartialEq> PartialEq for Tr<W>
impl<W: PartialEq> PartialEq for Tr<W>
source§impl<W: PartialOrd> PartialOrd for Tr<W>
impl<W: PartialOrd> PartialOrd for Tr<W>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<W: Eq> Eq for Tr<W>
impl<W> StructuralPartialEq for Tr<W>
Auto Trait Implementations§
impl<W> Freeze for Tr<W>where
W: Freeze,
impl<W> RefUnwindSafe for Tr<W>where
W: RefUnwindSafe,
impl<W> Send for Tr<W>where
W: Send,
impl<W> Sync for Tr<W>where
W: Sync,
impl<W> Unpin for Tr<W>where
W: Unpin,
impl<W> UnwindSafe for Tr<W>where
W: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more