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 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
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>
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more