pub(crate) struct RenderContext<'a> {
completion: &'a CompletionContext<'a>,
is_private_editable: bool,
import_to_add: Option<LocatedImport>,
doc_aliases: Vec<SmolStr>,
}Expand description
Interface for data and methods required for items rendering.
Fields§
§completion: &'a CompletionContext<'a>§is_private_editable: bool§import_to_add: Option<LocatedImport>§doc_aliases: Vec<SmolStr>Implementations§
Source§impl<'a> RenderContext<'a>
impl<'a> RenderContext<'a>
pub(crate) fn new(completion: &'a CompletionContext<'a>) -> RenderContext<'a>
pub(crate) fn private_editable(self, private_editable: bool) -> Self
pub(crate) fn import_to_add(self, import_to_add: Option<LocatedImport>) -> Self
pub(crate) fn doc_aliases(self, doc_aliases: Vec<SmolStr>) -> Self
fn snippet_cap(&self) -> Option<SnippetCap>
fn db(&self) -> &'a RootDatabase
fn source_range(&self) -> TextRange
fn completion_relevance(&self) -> CompletionRelevance
fn is_immediately_after_macro_bang(&self) -> bool
fn is_deprecated(&self, def: impl HasAttrs) -> bool
fn is_deprecated_assoc_item(&self, as_assoc_item: impl AsAssocItem) -> bool
fn docs(&self, def: impl HasDocs) -> Option<Documentation<'a>>
Trait Implementations§
Source§impl<'a> Clone for RenderContext<'a>
impl<'a> Clone for RenderContext<'a>
Source§fn clone(&self) -> RenderContext<'a>
fn clone(&self) -> RenderContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for RenderContext<'a>
impl<'a> !RefUnwindSafe for RenderContext<'a>
impl<'a> !Send for RenderContext<'a>
impl<'a> !Sync for RenderContext<'a>
impl<'a> Unpin for RenderContext<'a>
impl<'a> !UnwindSafe for RenderContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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