Struct slint_interpreter::CompilationResult
source · pub struct CompilationResult { /* private fields */ }
Expand description
The result of a compilation
If Self::has_errors()
is true, then the compilation failed.
The Self::diagnostics()
function can be used to retrieve the diagnostics (errors and/or warnings)
or Self::print_diagnostics()
can be used to print them to stderr.
The components can be retrieved using Self::components()
Implementations§
source§impl CompilationResult
impl CompilationResult
sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if the compilation failed.
The errors can be retrieved using the Self::diagnostics()
function.
sourcepub fn diagnostics(&self) -> impl Iterator<Item = Diagnostic> + '_
pub fn diagnostics(&self) -> impl Iterator<Item = Diagnostic> + '_
Return an iterator over the diagnostics.
You can also call Self::print_diagnostics()
to output the diagnostics to stderr
sourcepub fn print_diagnostics(&self)
pub fn print_diagnostics(&self)
Print the diagnostics to stderr
The diagnostics are printed in the same style as rustc errors
This function is available when the display-diagnostics
is enabled.
sourcepub fn components(&self) -> impl Iterator<Item = ComponentDefinition> + '_
pub fn components(&self) -> impl Iterator<Item = ComponentDefinition> + '_
Returns an iterator over the compiled components.
sourcepub fn component_names(&self) -> impl Iterator<Item = &str> + '_
pub fn component_names(&self) -> impl Iterator<Item = &str> + '_
Returns the names of the components that were compiled.
sourcepub fn component(&self, name: &str) -> Option<ComponentDefinition>
pub fn component(&self, name: &str) -> Option<ComponentDefinition>
Return the component definition for the given name.
If the component does not exist, then None
is returned.
Trait Implementations§
source§impl Clone for CompilationResult
impl Clone for CompilationResult
source§fn clone(&self) -> CompilationResult
fn clone(&self) -> CompilationResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CompilationResult
impl !RefUnwindSafe for CompilationResult
impl !Send for CompilationResult
impl !Sync for CompilationResult
impl Unpin for CompilationResult
impl !UnwindSafe for CompilationResult
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more