Enum rustpython_vm::function::FsPath
source · pub enum FsPath {
Str(PyStrRef),
Bytes(PyBytesRef),
}
Variants§
Str(PyStrRef)
Bytes(PyBytesRef)
Implementations§
source§impl FsPath
impl FsPath
pub fn try_from( obj: PyObjectRef, check_for_nul: bool, vm: &VirtualMachine ) -> PyResult<Self>
pub fn as_os_str(&self, vm: &VirtualMachine) -> PyResult<&OsStr>
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_str(&self) -> &str
pub fn to_path_buf(&self, vm: &VirtualMachine) -> PyResult<PathBuf>
pub fn to_cstring(&self, vm: &VirtualMachine) -> PyResult<CString>
pub fn to_widecstring(&self, vm: &VirtualMachine) -> PyResult<WideCString>
pub fn bytes_as_osstr<'a>( b: &'a [u8], vm: &VirtualMachine ) -> PyResult<&'a OsStr>
Trait Implementations§
source§impl ToPyObject for FsPath
impl ToPyObject for FsPath
fn to_pyobject(self, _vm: &VirtualMachine) -> PyObjectRef
source§impl TryFromObject for FsPath
impl TryFromObject for FsPath
source§fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
Attempt to convert a Python object to a value of this type.
Auto Trait Implementations§
impl !RefUnwindSafe for FsPath
impl !Send for FsPath
impl !Sync for FsPath
impl Unpin for FsPath
impl !UnwindSafe for FsPath
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
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere U: ExactFrom<T>,
fn exact_into(self) -> U
source§impl<T> FromArgOptional for Twhere
T: TryFromObject,
impl<T> FromArgOptional for Twhere T: TryFromObject,
type Inner = T
fn from_inner(x: T) -> T
source§impl<T> FromArgs for Twhere
T: TryFromObject,
impl<T> FromArgs for Twhere T: TryFromObject,
source§fn arity() -> RangeInclusive<usize>
fn arity() -> RangeInclusive<usize>
The range of positional arguments permitted by the function signature. Read more
source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs
) -> Result<T, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs ) -> Result<T, ArgumentError>
Extracts this item from the next argument(s).