pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
    fn read_os_str_from_c_str<'a>(
        &'a self,
        ptr: Pointer<Option<Provenance>>
    ) -> InterpResult<'tcx, &'a OsStr>
   where
        'tcx: 'a,
        'mir: 'a
, { ... } fn read_os_str_from_wide_str<'a>(
        &'a self,
        ptr: Pointer<Option<Provenance>>
    ) -> InterpResult<'tcx, OsString>
   where
        'tcx: 'a,
        'mir: 'a
, { ... } fn write_os_str_to_c_str(
        &mut self,
        os_str: &OsStr,
        ptr: Pointer<Option<Provenance>>,
        size: u64
    ) -> InterpResult<'tcx, (bool, u64)> { ... } fn write_os_str_to_wide_str(
        &mut self,
        os_str: &OsStr,
        ptr: Pointer<Option<Provenance>>,
        size: u64
    ) -> InterpResult<'tcx, (bool, u64)> { ... } fn alloc_os_str_as_c_str(
        &mut self,
        os_str: &OsStr,
        memkind: MemoryKind<MiriMemoryKind>
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... } fn alloc_os_str_as_wide_str(
        &mut self,
        os_str: &OsStr,
        memkind: MemoryKind<MiriMemoryKind>
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... } fn read_path_from_c_str<'a>(
        &'a self,
        ptr: Pointer<Option<Provenance>>
    ) -> InterpResult<'tcx, Cow<'a, Path>>
   where
        'tcx: 'a,
        'mir: 'a
, { ... } fn read_path_from_wide_str(
        &self,
        ptr: Pointer<Option<Provenance>>
    ) -> InterpResult<'tcx, PathBuf> { ... } fn write_path_to_c_str(
        &mut self,
        path: &Path,
        ptr: Pointer<Option<Provenance>>,
        size: u64
    ) -> InterpResult<'tcx, (bool, u64)> { ... } fn write_path_to_wide_str(
        &mut self,
        path: &Path,
        ptr: Pointer<Option<Provenance>>,
        size: u64
    ) -> InterpResult<'tcx, (bool, u64)> { ... } fn alloc_path_as_c_str(
        &mut self,
        path: &Path,
        memkind: MemoryKind<MiriMemoryKind>
    ) -> InterpResult<'tcx, Pointer<Option<Provenance>>> { ... } fn convert_path_separator<'a>(
        &self,
        os_str: Cow<'a, OsStr>,
        direction: PathConversion
    ) -> Cow<'a, OsStr> { ... } }

Provided Methods

Helper function to read an OsString from a null-terminated sequence of bytes, which is what the Unix APIs usually handle.

Helper function to read an OsString from a 0x0000-terminated sequence of u16, which is what the Windows APIs usually handle.

Helper function to write an OsStr as a null-terminated sequence of bytes, which is what the Unix APIs usually handle. This function returns Ok((false, length)) without trying to write if size is not large enough to fit the contents of os_string plus a null terminator. It returns Ok((true, length)) if the writing process was successful. The string length returned does include the null terminator.

Helper function to write an OsStr as a 0x0000-terminated u16-sequence, which is what the Windows APIs usually handle. This function returns Ok((false, length)) without trying to write if size is not large enough to fit the contents of os_string plus a null terminator. It returns Ok((true, length)) if the writing process was successful. The string length returned does include the null terminator. Length is measured in units of u16.

Allocate enough memory to store the given OsStr as a null-terminated sequence of bytes.

Allocate enough memory to store the given OsStr as a null-terminated sequence of u16.

Read a null-terminated sequence of bytes, and perform path separator conversion if needed.

Read a null-terminated sequence of u16s, and perform path separator conversion if needed.

Write a Path to the machine memory (as a null-terminated sequence of bytes), adjusting path separators if needed.

Write a Path to the machine memory (as a null-terminated sequence of u16s), adjusting path separators if needed.

Allocate enough memory to store a Path as a null-terminated sequence of bytes, adjusting path separators if needed.

Implementors