Struct ra_ap_hir_expand::ExpandResult [−][src]
pub struct ExpandResult<T> { pub value: T, pub err: Option<ExpandError>, }
Fields
value: T
err: Option<ExpandError>
Implementations
impl<T> ExpandResult<T>
[src]
impl<T> ExpandResult<T>
[src]pub fn ok(value: T) -> ExpandResult<T>
[src]
pub fn only_err(err: ExpandError) -> ExpandResult<T> where
T: Default,
[src]
T: Default,
pub fn str_err(err: String) -> ExpandResult<T> where
T: Default,
[src]
T: Default,
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> ExpandResult<U>
[src]
pub fn result(self) -> Result<T, ExpandError>
[src]
Trait Implementations
impl<T> Clone for ExpandResult<T> where
T: Clone,
[src]
impl<T> Clone for ExpandResult<T> where
T: Clone,
[src]pub fn clone(&self) -> ExpandResult<T>
[src]
pub fn clone(&self) -> ExpandResult<T>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<T> Debug for ExpandResult<T> where
T: Debug,
[src]
impl<T> Debug for ExpandResult<T> where
T: Debug,
[src]impl<T> From<Result<T, ExpandError>> for ExpandResult<T> where
T: Default,
[src]
impl<T> From<Result<T, ExpandError>> for ExpandResult<T> where
T: Default,
[src]pub fn from(result: Result<T, ExpandError>) -> ExpandResult<T>
[src]
pub fn from(result: Result<T, ExpandError>) -> ExpandResult<T>
[src]Performs the conversion.
impl<T> PartialEq<ExpandResult<T>> for ExpandResult<T> where
T: PartialEq<T>,
[src]
impl<T> PartialEq<ExpandResult<T>> for ExpandResult<T> where
T: PartialEq<T>,
[src]pub fn eq(&self, other: &ExpandResult<T>) -> bool
[src]
pub fn eq(&self, other: &ExpandResult<T>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &ExpandResult<T>) -> bool
[src]
pub fn ne(&self, other: &ExpandResult<T>) -> bool
[src]This method tests for !=
.
impl<T> Eq for ExpandResult<T> where
T: Eq,
[src]
T: Eq,
impl<T> StructuralEq for ExpandResult<T>
[src]
impl<T> StructuralPartialEq for ExpandResult<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for ExpandResult<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ExpandResult<T> where
T: Send,
T: Send,
impl<T> Sync for ExpandResult<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ExpandResult<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ExpandResult<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more