Struct ra_ap_hir_def::dyn_map::keys::AstPtrPolicy

source ·
pub struct AstPtrPolicy<AST, ID> { /* private fields */ }
Expand description

XXX: AST Nodes and SyntaxNodes have identity equality semantics: nodes are equal if they point to exactly the same object.

In general, we do not guarantee that we have exactly one instance of a syntax tree for each file. We probably should add such guarantee, but, for the time being, we will use identity-less AstPtr comparison.

Trait Implementations§

source§

impl<AST: AstNode + 'static, ID: 'static> Policy for AstPtrPolicy<AST, ID>

§

type K = AstPtr<AST>

§

type V = ID

source§

fn insert(map: &mut DynMap, key: AstPtr<AST>, value: ID)

source§

fn get<'a>(map: &'a DynMap, key: &AstPtr<AST>) -> Option<&'a ID>

source§

fn is_empty(map: &DynMap) -> bool

Auto Trait Implementations§

§

impl<AST, ID> Freeze for AstPtrPolicy<AST, ID>

§

impl<AST, ID> RefUnwindSafe for AstPtrPolicy<AST, ID>
where AST: RefUnwindSafe, ID: RefUnwindSafe,

§

impl<AST, ID> Send for AstPtrPolicy<AST, ID>
where AST: Send, ID: Send,

§

impl<AST, ID> Sync for AstPtrPolicy<AST, ID>
where AST: Sync, ID: Sync,

§

impl<AST, ID> Unpin for AstPtrPolicy<AST, ID>
where AST: Unpin, ID: Unpin,

§

impl<AST, ID> UnwindSafe for AstPtrPolicy<AST, ID>
where AST: UnwindSafe, ID: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoBox<dyn Any> for T
where T: Any,

source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

source§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Send + Sync> for T
where T: Any + Send + Sync,

source§

fn into_box(self) -> Box<dyn Any + Send + Sync>

Convert self into the appropriate boxed form.
source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more