pub struct BufferingSrtFrameWriter { /* private fields */ }Expand description
A buffering SrtWriter which is meant to be called for every frame.
This buffers values from each frame until the next frame. In this way, it can calculate start and stop times for each frame. The first call to Self::add_frame thus only stores the buffer, and the buffered value is written upon Self::close or Self::drop.
Implementations§
Source§impl BufferingSrtFrameWriter
impl BufferingSrtFrameWriter
pub fn new(wtr: Box<dyn Write>) -> Self
pub fn add_frame(&mut self, pts: Duration, val: String) -> Result<()>
Sourcepub fn flush(&mut self) -> Result<()>
pub fn flush(&mut self) -> Result<()>
Flush the underlying writer.
Note that this does not flush the currently buffered value, as that would require creating a new timestamp.
pub fn close(self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferingSrtFrameWriter
impl !RefUnwindSafe for BufferingSrtFrameWriter
impl !Send for BufferingSrtFrameWriter
impl !Sync for BufferingSrtFrameWriter
impl Unpin for BufferingSrtFrameWriter
impl UnsafeUnpin for BufferingSrtFrameWriter
impl !UnwindSafe for BufferingSrtFrameWriter
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