pub struct Arc<W: Semiring> {
pub ilabel: Label,
pub olabel: Label,
pub weight: W,
pub nextstate: StateId,
}
Expand description
Arc structure.
Fields
ilabel: Label
olabel: Label
weight: W
nextstate: StateId
Implementations
sourceimpl<W: Semiring> Arc<W>
impl<W: Semiring> Arc<W>
sourcepub fn new(ilabel: Label, olabel: Label, weight: W, nextstate: StateId) -> Self
pub fn new(ilabel: Label, olabel: Label, weight: W, nextstate: StateId) -> Self
Creates a new Arc.
Example
use rustfst::arc::Arc;
use rustfst::semirings::{BooleanWeight, Semiring};
let arc = Arc::new(0, 1, BooleanWeight::one(), 2);
assert_eq!(arc.ilabel, 0);
assert_eq!(arc.olabel, 1);
assert_eq!(arc.weight, BooleanWeight::one());
assert_eq!(arc.nextstate, 2);
sourcepub fn set_value(&mut self, arc: &Arc<W>)
pub fn set_value(&mut self, arc: &Arc<W>)
Updates the values of the attributes of the Arc from another Arc.
Example
use rustfst::arc::Arc;
use rustfst::semirings::{BooleanWeight, Semiring};
let mut arc_1 = Arc::new(0, 1, BooleanWeight::one(), 2);
let arc_2 = Arc::new(1, 2, BooleanWeight::zero(), 3);
arc_1.set_value(&arc_2);
assert_eq!(arc_1, arc_2);
Trait Implementations
sourceimpl<W: PartialEq + Semiring> PartialEq<Arc<W>> for Arc<W>
impl<W: PartialEq + Semiring> PartialEq<Arc<W>> for Arc<W>
impl<W: Semiring> StructuralPartialEq for Arc<W>
Auto Trait Implementations
impl<W> RefUnwindSafe for Arc<W>where
W: RefUnwindSafe,
impl<W> Send for Arc<W>where
W: Send,
impl<W> Sync for Arc<W>where
W: Sync,
impl<W> Unpin for Arc<W>where
W: Unpin,
impl<W> UnwindSafe for Arc<W>where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more