Struct sway_core::error::CompileResult
source · [−]pub struct CompileResult<T> {
pub value: Option<T>,
pub warnings: Vec<CompileWarning>,
pub errors: Vec<CompileError>,
}
Fields
value: Option<T>
warnings: Vec<CompileWarning>
errors: Vec<CompileError>
Implementations
sourceimpl<T> CompileResult<T>
impl<T> CompileResult<T>
pub fn is_ok(&self) -> bool
pub fn is_ok_no_warn(&self) -> bool
pub fn new(
value: Option<T>,
warnings: Vec<CompileWarning>,
errors: Vec<CompileError>
) -> Self
pub fn ok(
self,
warnings: &mut Vec<CompileWarning>,
errors: &mut Vec<CompileError>
) -> Option<T>
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> CompileResult<U>
pub fn flat_map<U, F: FnOnce(T) -> CompileResult<U>>(
self,
f: F
) -> CompileResult<U>
pub fn unwrap(
self,
warnings: &mut Vec<CompileWarning>,
errors: &mut Vec<CompileError>
) -> T
pub fn unwrap_or_else<F: FnOnce() -> T>(
self,
warnings: &mut Vec<CompileWarning>,
errors: &mut Vec<CompileError>,
or_else: F
) -> T
sourceimpl<'a, T> CompileResult<&'a T> where
T: Clone,
impl<'a, T> CompileResult<&'a T> where
T: Clone,
sourcepub fn cloned(self) -> CompileResult<T>
pub fn cloned(self) -> CompileResult<T>
Converts a CompileResult
around a reference value to an owned value by cloning the type
behind the reference.
Trait Implementations
sourceimpl<T: Clone> Clone for CompileResult<T>
impl<T: Clone> Clone for CompileResult<T>
sourcefn clone(&self) -> CompileResult<T>
fn clone(&self) -> CompileResult<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for CompileResult<T>
impl<T: Debug> Debug for CompileResult<T>
sourceimpl<T> From<Result<T, CompileError>> for CompileResult<T>
impl<T> From<Result<T, CompileError>> for CompileResult<T>
sourcefn from(o: Result<T, CompileError>) -> Self
fn from(o: Result<T, CompileError>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<T> RefUnwindSafe for CompileResult<T> where
T: RefUnwindSafe,
impl<T> Send for CompileResult<T> where
T: Send,
impl<T> Sync for CompileResult<T> where
T: Sync,
impl<T> Unpin for CompileResult<T> where
T: Unpin,
impl<T> UnwindSafe for CompileResult<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more