Enum rustpython_vm::function::ArgStrOrBytesLike
source · pub enum ArgStrOrBytesLike {
Buf(ArgBytesLike),
Str(PyStrRef),
}
Expand description
A text string or bytes-like object. Like the s*
format code for PyArg_Parse
in CPython.
Variants§
Buf(ArgBytesLike)
Str(PyStrRef)
Implementations§
source§impl ArgStrOrBytesLike
impl ArgStrOrBytesLike
pub fn borrow_bytes(&self) -> BorrowedValue<'_, [u8]>
Trait Implementations§
source§impl TryFromObject for ArgStrOrBytesLike
impl TryFromObject for ArgStrOrBytesLike
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 Freeze for ArgStrOrBytesLike
impl !RefUnwindSafe for ArgStrOrBytesLike
impl !Send for ArgStrOrBytesLike
impl !Sync for ArgStrOrBytesLike
impl Unpin for ArgStrOrBytesLike
impl !UnwindSafe for ArgStrOrBytesLike
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> 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).