pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
fn read_os_str_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, &'a OsStr>
where
'tcx: 'a,
'mir: 'a,
{ ... }
fn read_os_str_from_wide_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, OsString>
where
'tcx: 'a,
'mir: 'a,
{ ... }
fn write_os_str_to_c_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)> { ... }
fn write_os_str_to_wide_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
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<Tag>>> { ... }
fn alloc_os_str_as_wide_str(
&mut self,
os_str: &OsStr,
memkind: MemoryKind<MiriMemoryKind>
) -> InterpResult<'tcx, Pointer<Option<Tag>>> { ... }
fn read_path_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, Cow<'a, Path>>
where
'tcx: 'a,
'mir: 'a,
{ ... }
fn read_path_from_wide_str(
&self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, PathBuf> { ... }
fn write_path_to_c_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)> { ... }
fn write_path_to_wide_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)> { ... }
fn convert_path_separator<'a>(
&self,
os_str: Cow<'a, OsStr>,
direction: PathConversion
) -> Cow<'a, OsStr> { ... }
}Provided Methods
fn read_os_str_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, &'a OsStr> where
'tcx: 'a,
'mir: 'a,
fn read_os_str_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, &'a OsStr> where
'tcx: 'a,
'mir: 'a,
Helper function to read an OsString from a null-terminated sequence of bytes, which is what the Unix APIs usually handle.
fn read_os_str_from_wide_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, OsString> where
'tcx: 'a,
'mir: 'a,
fn read_os_str_from_wide_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, OsString> where
'tcx: 'a,
'mir: 'a,
Helper function to read an OsString from a 0x0000-terminated sequence of u16, which is what the Windows APIs usually handle.
fn write_os_str_to_c_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
fn write_os_str_to_c_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
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 not include the null terminator.
fn write_os_str_to_wide_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
fn write_os_str_to_wide_str(
&mut self,
os_str: &OsStr,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
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 not include the null terminator.
fn alloc_os_str_as_c_str(
&mut self,
os_str: &OsStr,
memkind: MemoryKind<MiriMemoryKind>
) -> InterpResult<'tcx, Pointer<Option<Tag>>>
fn alloc_os_str_as_c_str(
&mut self,
os_str: &OsStr,
memkind: MemoryKind<MiriMemoryKind>
) -> InterpResult<'tcx, Pointer<Option<Tag>>>
Allocate enough memory to store the given OsStr as a null-terminated sequence of bytes.
fn alloc_os_str_as_wide_str(
&mut self,
os_str: &OsStr,
memkind: MemoryKind<MiriMemoryKind>
) -> InterpResult<'tcx, Pointer<Option<Tag>>>
fn alloc_os_str_as_wide_str(
&mut self,
os_str: &OsStr,
memkind: MemoryKind<MiriMemoryKind>
) -> InterpResult<'tcx, Pointer<Option<Tag>>>
Allocate enough memory to store the given OsStr as a null-terminated sequence of u16.
fn read_path_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, Cow<'a, Path>> where
'tcx: 'a,
'mir: 'a,
fn read_path_from_c_str<'a>(
&'a self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, Cow<'a, Path>> where
'tcx: 'a,
'mir: 'a,
Read a null-terminated sequence of bytes, and perform path separator conversion if needed.
fn read_path_from_wide_str(
&self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, PathBuf>
fn read_path_from_wide_str(
&self,
ptr: Pointer<Option<Tag>>
) -> InterpResult<'tcx, PathBuf>
Read a null-terminated sequence of u16s, and perform path separator conversion if needed.
fn write_path_to_c_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
fn write_path_to_c_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
Write a Path to the machine memory (as a null-terminated sequence of bytes), adjusting path separators if needed.
fn write_path_to_wide_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
fn write_path_to_wide_str(
&mut self,
path: &Path,
ptr: Pointer<Option<Tag>>,
size: u64
) -> InterpResult<'tcx, (bool, u64)>
Write a Path to the machine memory (as a null-terminated sequence of u16s),
adjusting path separators if needed.