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: PartialOrd> PartialOrd for Tr<W>
impl<W: PartialOrd> PartialOrd for Tr<W>
impl<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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