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 copy 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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