Struct rustfst::arc::Arc

source ·
pub struct Arc<W: Semiring> {
    pub ilabel: Label,
    pub olabel: Label,
    pub weight: W,
    pub nextstate: StateId,
}
Expand description

Arc structure.

Fields

ilabel: Labelolabel: Labelweight: Wnextstate: StateId

Implementations

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);

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.