R/headr.R

Defines functions headr

Documented in headr

#' Header of Rust file
#'
#' These lines should be in the head of lib.rs file.
#'
#' @examples
#' \dontrun{
#'
#' #[macro_use]
#' extern crate rustr;
#' pub mod export;
#' pub use rustr::*;
#'
#' // #[rustr_export]
#' pub fn say_hi()->RResult<String>{
#'     Ok("hello world".into())
#' }
#' }
#' @export
headr = function() {
    cat(
        '#[macro_use]\nextern crate rustr;\npub mod export;\npub use rustr::*;\n\n// #[rustr_export]\npub fn say_hi()->RResult<String>{\n   Ok("hello world".into())\n}'
    )
}
rustr/rustinr documentation built on June 2, 2020, 2:05 a.m.