pub struct Entry<'a> { /* private fields */ }
Available on crate feature
cli
only.Expand description
A rune-based entrypoint used for custom applications.
This can be used to construct your own rune-based environment, with a custom configuration such as your own modules.
Implementations§
Source§impl<'a> Entry<'a>
impl<'a> Entry<'a>
Sourcepub fn about(self, about: impl Display) -> Self
pub fn about(self, about: impl Display) -> Self
Set about string used in cli output.
For example, this is the first row outputted when the command prints its help text.
§Examples
rune::cli::Entry::new()
.about("My own interpreter")
.run();
Sourcepub fn context(self, context: &'a mut ContextBuilder) -> Self
pub fn context(self, context: &'a mut ContextBuilder) -> Self
Configure context to use using a builder.
§Examples
use rune::{Context, ContextError, Module};
fn my_module() -> Result<Module, ContextError> {
let module = Module::default();
/* install things into module */
Ok(module)
}
rune::cli::Entry::new()
.about("My own interpreter")
.context(&mut |opts| {
let mut c = Context::with_config(opts.capture.is_none())?;
c.install(my_module()?);
Ok(c)
})
.run();
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Entry<'a>
impl<'a> !RefUnwindSafe for Entry<'a>
impl<'a> !Send for Entry<'a>
impl<'a> !Sync for Entry<'a>
impl<'a> Unpin for Entry<'a>
impl<'a> !UnwindSafe for Entry<'a>
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