pub struct NDPluginFileBase {
pub file_path: String,
pub file_name: String,
pub file_number: i32,
pub file_template: String,
pub auto_increment: bool,
pub temp_suffix: String,
pub create_dir: i32,
/* private fields */
}Expand description
File path/name management and capture buffering for file plugins.
Fields§
§file_path: String§file_name: String§file_number: i32§file_template: String§auto_increment: bool§temp_suffix: String§create_dir: i32Implementations§
Source§impl NDPluginFileBase
impl NDPluginFileBase
pub fn new() -> Self
Sourcepub fn create_file_name(&self) -> String
pub fn create_file_name(&self) -> String
Construct the full file path from template/path/name/number.
Sourcepub fn temp_file_path(&self) -> Option<PathBuf>
pub fn temp_file_path(&self) -> Option<PathBuf>
Get the temp file path (if temp_suffix is set).
Sourcepub fn ensure_directory(&self) -> ADResult<()>
pub fn ensure_directory(&self) -> ADResult<()>
Create directory if needed.
Sourcepub fn process_array(
&mut self,
array: Arc<NDArray>,
writer: &mut dyn NDFileWriter,
) -> ADResult<()>
pub fn process_array( &mut self, array: Arc<NDArray>, writer: &mut dyn NDFileWriter, ) -> ADResult<()>
Process an incoming array according to the current file mode.
Sourcepub fn flush_capture(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
pub fn flush_capture(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
Flush capture buffer: open file, write all buffered arrays, close.
Sourcepub fn close_stream(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
pub fn close_stream(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
Close stream mode.
pub fn set_mode(&mut self, mode: NDFileMode)
pub fn set_num_capture(&mut self, n: usize)
pub fn num_captured(&self) -> usize
Auto Trait Implementations§
impl Freeze for NDPluginFileBase
impl RefUnwindSafe for NDPluginFileBase
impl Send for NDPluginFileBase
impl Sync for NDPluginFileBase
impl Unpin for NDPluginFileBase
impl UnsafeUnpin for NDPluginFileBase
impl UnwindSafe for NDPluginFileBase
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