pub struct RFile {
pub imports: Vec<String>,
pub functions: Vec<RFunction>,
pub scripts: Vec<RStmt>,
pub data_objects: Vec<RDataObject>,
pub header_comment: Option<String>,
pub shebang: Option<String>,
}Expand description
Top-level R file structure.
Fields§
§imports: Vec<String>Package imports (library calls)
functions: Vec<RFunction>Top-level function definitions
scripts: Vec<RStmt>Top-level script statements (non-function)
data_objects: Vec<RDataObject>Data object definitions
header_comment: Option<String>File-level comment header
shebang: Option<String>Shebang line (e.g., #!/usr/bin/env Rscript)
Implementations§
Source§impl RFile
impl RFile
pub fn new() -> Self
pub fn with_header(self, comment: &str) -> Self
pub fn add_import(&mut self, pkg: &str)
pub fn add_function(&mut self, fun: RFunction)
pub fn add_script_stmt(&mut self, stmt: RStmt)
pub fn add_data(&mut self, obj: RDataObject)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RFile
impl RefUnwindSafe for RFile
impl Send for RFile
impl Sync for RFile
impl Unpin for RFile
impl UnsafeUnpin for RFile
impl UnwindSafe for RFile
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