Struct audio_util::FileStreamSourceGenerator
source · pub struct FileStreamSourceGenerator {
file: File,
file_size: usize,
offset: Arc<AtomicUsize>,
}
Expand description
FileStreamSourceGenerator
is a struct that implements [StreamSourceGenerator
]
for FileStreamSource
.
Fields§
§file: File
File descriptor which will be used to write playback buffer.
file_size: usize
Size of the output file in bytes.
offset: Arc<AtomicUsize>
Number of bytes that has been written to the file.
Implementations§
source§impl FileStreamSourceGenerator
impl FileStreamSourceGenerator
sourcepub fn new(file: File, file_size: usize) -> Self
pub fn new(file: File, file_size: usize) -> Self
Creates a new FileStreamSourceGenerator
by given arguments.
It expects file
has file_size
of bytes allocated spaces.
§Arguments
file
- The file where audio playback buffer will be written.file_size
- The size of bytes allocated for playback_file.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for FileStreamSourceGenerator
impl Send for FileStreamSourceGenerator
impl Sync for FileStreamSourceGenerator
impl Unpin for FileStreamSourceGenerator
impl UnwindSafe for FileStreamSourceGenerator
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