[−][src]Struct rustc_interface::queries::Query
Represent the result of a query.
This result can be stolen with the take method and generated with the compute method.
Fields
result: RefCell<Option<Result<T>>>Implementations
impl<T> Query<T>[src]
pub(in queries) fn compute<F: FnOnce() -> Result<T>>(
&self,
f: F
) -> Result<&Query<T>>[src]
&self,
f: F
) -> Result<&Query<T>>
pub fn take(&self) -> T[src]
Takes ownership of the query result. Further attempts to take or peek the query
result will panic unless it is generated by calling the compute method.
pub fn peek(&self) -> Ref<'_, T>[src]
Borrows the query result using the RefCell. Panics if the result is stolen.
pub fn peek_mut(&self) -> RefMut<'_, T>[src]
Mutably borrows the query result using the RefCell. Panics if the result is stolen.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Query<T>
impl<T> Send for Query<T> where
T: Send,
T: Send,
impl<T> !Sync for Query<T>
impl<T> Unpin for Query<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Query<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,