[−][src]Struct rustc_interface::queries::Query

pub struct Query<T> {
    result: RefCell<Option<Result<T>>>,
}

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]

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

impl<T> Default for Query<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Query<T>

impl<T> Send for Query<T> where
    T: Send, 

impl<T> !Sync for Query<T>

impl<T> Unpin for Query<T> where
    T: Unpin, 

impl<T> UnwindSafe for Query<T> where
    T: UnwindSafe, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.