pub struct ReadStatPath {
pub path: PathBuf,
pub extension: String,
pub cstring_path: CString,
}Expand description
Validated file path for SAS file input.
Encapsulates the input .sas7bdat path (validated to exist with correct extension).
The input path is also converted to a CString for passing to the ReadStat C library.
Fields§
§path: PathBufAbsolute path to the input .sas7bdat file.
extension: StringFile extension of the input file (e.g. "sas7bdat").
cstring_path: CStringInput path as a C-compatible string for FFI.
Implementations§
Source§impl ReadStatPath
impl ReadStatPath
Sourcepub fn new(path: PathBuf) -> Result<Self, ReadStatError>
pub fn new(path: PathBuf) -> Result<Self, ReadStatError>
Creates a new ReadStatPath after validating the input path.
§Errors
Returns ReadStatError if the path does not exist or has an invalid extension.
Sourcepub(crate) fn path_to_cstring(path: &Path) -> Result<CString, ReadStatError>
pub(crate) fn path_to_cstring(path: &Path) -> Result<CString, ReadStatError>
Converts a file path to a CString for FFI. Uses raw bytes on Unix.
fn validate_in_extension(path: &Path) -> Result<String, ReadStatError>
fn validate_path(path: &Path) -> Result<PathBuf, ReadStatError>
Trait Implementations§
Source§impl Clone for ReadStatPath
impl Clone for ReadStatPath
Source§fn clone(&self) -> ReadStatPath
fn clone(&self) -> ReadStatPath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReadStatPath
impl RefUnwindSafe for ReadStatPath
impl Send for ReadStatPath
impl Sync for ReadStatPath
impl Unpin for ReadStatPath
impl UnwindSafe for ReadStatPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more