pub struct LiveRunner { /* private fields */ }Expand description
Runs the code of a Playground with the interpreter: its first
function, which returns impl View, is called and shown. The program’s own use lines
are read and left alone; what it does not read comes back as diagnostics with their place.
use ravenrs_widgets::{LiveRunner, Runner};
let view = LiveRunner::new().run(r#"fn hello() -> impl View { Text::new("hello") }"#);
assert!(view.is_ok());Implementations§
Source§impl LiveRunner
impl LiveRunner
Sourcepub fn new() -> Self
pub fn new() -> Self
A runner over live_registry.
Sourcepub fn with_registry(registry: Registry) -> Self
pub fn with_registry(registry: Registry) -> Self
A runner over a registry of the app’s own, such as one with more types added.
Trait Implementations§
Source§impl Clone for LiveRunner
impl Clone for LiveRunner
Source§fn clone(&self) -> LiveRunner
fn clone(&self) -> LiveRunner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LiveRunner
impl Debug for LiveRunner
Source§impl Default for LiveRunner
impl Default for LiveRunner
Source§impl Runner for LiveRunner
impl Runner for LiveRunner
Source§fn run(&self, source: &str) -> Result<AnyView, Vec<CodeDiagnostic>>
fn run(&self, source: &str) -> Result<AnyView, Vec<CodeDiagnostic>>
The view
source makes, or where and why it cannot make one.Source§fn take_output(&self) -> RunOutput
fn take_output(&self) -> RunOutput
What the code printed, and the problems of what it runs later, such as a closure on a
click, since the last time this was asked. Nothing, unless the runner keeps them.
Auto Trait Implementations§
impl !RefUnwindSafe for LiveRunner
impl !Send for LiveRunner
impl !Sync for LiveRunner
impl !UnwindSafe for LiveRunner
impl Freeze for LiveRunner
impl Unpin for LiveRunner
impl UnsafeUnpin for LiveRunner
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