pub struct Gate { /* private fields */ }Available on crate feature
silero and non-target_family=wasm only.Expand description
Holds decoded segments until the timeline decides them.
Implementations§
Source§impl Gate
impl Gate
Sourcepub fn new(admission: Admission, from: u64) -> Self
pub fn new(admission: Admission, from: u64) -> Self
from is where the recording starts in the stream.
pub fn admission(&self) -> Admission
Sourcepub fn undecided_from(&self) -> Option<u64>
pub fn undecided_from(&self) -> Option<u64>
Where the oldest held segment’s audio starts, while one is held.
Sourcepub fn hold(&mut self, heard: Heard)
pub fn hold(&mut self, heard: Heard)
A finalized segment joins the queue. It replaces the provisional text it came from.
Sourcepub fn propose(
&mut self,
text: String,
source_window: Option<Range<u64>>,
read_to: u64,
)
pub fn propose( &mut self, text: String, source_window: Option<Range<u64>>, read_to: u64, )
The decoder’s latest provisional text replaces the last.
Sourcepub fn decide(
&mut self,
timeline: &Timeline,
speech: Option<&SpeechMap>,
) -> Decision
pub fn decide( &mut self, timeline: &Timeline, speech: Option<&SpeechMap>, ) -> Decision
Decides what the timeline and the speech map allow out now. The preview is judged before the release, against the segments held when it was asked for. Without a speech map, every recording counts as speech.
Auto Trait Implementations§
impl Freeze for Gate
impl RefUnwindSafe for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl UnsafeUnpin for Gate
impl UnwindSafe for Gate
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