pub enum ResolvedSnippet<'a, Q: QueryContext> {
Text(Cow<'a, str>),
Binding(Q::Binding<'a>),
LazyFn(Box<LazyBuiltIn<'a, Q>>),
}
Variants§
Implementations§
Source§impl<'a, Q: QueryContext> ResolvedSnippet<'a, Q>
impl<'a, Q: QueryContext> ResolvedSnippet<'a, Q>
pub fn from_binding(binding: Q::Binding<'a>) -> ResolvedSnippet<'_, Q>
pub fn padding( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<usize>
pub fn text( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<Cow<'a, str>>
pub fn linearized_text( &self, language: &Q::Language<'a>, effects: &[Effect<'a, Q>], files: &FileRegistry<'a, Q>, memo: &mut HashMap<CodeRange, Option<String>>, distributed_indent: Option<usize>, logs: &mut AnalysisLogs, ) -> GritResult<Cow<'_, str>>
pub fn is_truthy( &self, state: &mut State<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<bool>
Trait Implementations§
Source§impl<'a, Q: Clone + QueryContext> Clone for ResolvedSnippet<'a, Q>
impl<'a, Q: Clone + QueryContext> Clone for ResolvedSnippet<'a, Q>
Source§fn clone(&self) -> ResolvedSnippet<'a, Q>
fn clone(&self) -> ResolvedSnippet<'a, Q>
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 moreSource§impl<'a, Q: Debug + QueryContext> Debug for ResolvedSnippet<'a, Q>
impl<'a, Q: Debug + QueryContext> Debug for ResolvedSnippet<'a, Q>
Source§impl<'a, Q: PartialEq + QueryContext> PartialEq for ResolvedSnippet<'a, Q>
impl<'a, Q: PartialEq + QueryContext> PartialEq for ResolvedSnippet<'a, Q>
impl<'a, Q: QueryContext> StructuralPartialEq for ResolvedSnippet<'a, Q>
Auto Trait Implementations§
impl<'a, Q> Freeze for ResolvedSnippet<'a, Q>
impl<'a, Q> RefUnwindSafe for ResolvedSnippet<'a, Q>where
<Q as QueryContext>::Binding<'a>: RefUnwindSafe,
<Q as QueryContext>::ResolvedPattern<'a>: RefUnwindSafe,
impl<'a, Q> Send for ResolvedSnippet<'a, Q>
impl<'a, Q> Sync for ResolvedSnippet<'a, Q>
impl<'a, Q> Unpin for ResolvedSnippet<'a, Q>
impl<'a, Q> UnwindSafe for ResolvedSnippet<'a, Q>where
<Q as QueryContext>::Binding<'a>: UnwindSafe,
<Q as QueryContext>::ResolvedPattern<'a>: UnwindSafe,
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,
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