pub struct Program {
pub variables: Vec<Variable>,
pub syscalls: Vec<Syscall>,
pub active_fds: Vec<i64>,
pub active_file_fds: Vec<i64>,
pub active_dir_fds: Vec<i64>,
pub active_map_base_idx: Vec<i64>,
pub avail_files: Vec<FileObject>,
pub avail_dirs: Vec<FileObject>,
pub avail_non_dirs: Vec<FileObject>,
}
Fields§
§variables: Vec<Variable>
§syscalls: Vec<Syscall>
§active_fds: Vec<i64>
§active_file_fds: Vec<i64>
§active_dir_fds: Vec<i64>
§active_map_base_idx: Vec<i64>
§avail_files: Vec<FileObject>
§avail_dirs: Vec<FileObject>
§avail_non_dirs: Vec<FileObject>
Implementations§
Source§impl Program
impl Program
pub const PAGE_SIZE: u32 = 4_096u32
pub const SRC8192: i64 = 0i64
pub const DEST8192: i64 = 1i64
pub const PATHSTART: i64 = 2i64
pub fn new() -> Self
pub fn prepare_buffers(&mut self)
pub fn create_str(&mut self, s: &str) -> i64
pub fn create_variable(&mut self, var_type: VariableType) -> i64
pub fn create_file_variable( &mut self, var_type: VariableType, kind: FileType, ) -> i64
pub fn add_fd(&mut self, fd_index: i64)
pub fn add_variable(&mut self, v: Variable)
pub fn remove_last_variable(&mut self)
pub fn add_syscall(&mut self, v: Syscall)
pub fn remove_last_syscall(&mut self)
pub fn remove_last_syscall_if_same(&mut self, syscall: Syscall)
pub fn remove_syscall(&mut self, syscall: Syscall)
pub fn add_file(&mut self, fobj: FileObject, var_index: i64)
pub fn remove_last_file(&mut self)
pub fn remove_file(&mut self, fobj: FileObject)
pub fn remove_dir(&mut self, fobj: FileObject)
pub fn remove_non_dir(&mut self, fobj: FileObject)
pub fn remove_fd(&mut self, fd_index: i64)
pub fn remove_file_fd(&mut self, fd_index: i64)
pub fn remove_dir_fd(&mut self, fd_index: i64)
pub fn mark_base_unmapped(&mut self, map_index: i64)
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn from_str(s: String) -> Result<Self, Error>
pub fn to_path<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn cprogram_to_file<P: AsRef<Path>>(&self, path: &mut P) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Program
impl<'de> Deserialize<'de> for Program
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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