Struct sqruff_lib::utils::functional::segments::Segments
source · pub struct Segments { /* private fields */ }
Implementations§
source§impl Segments
impl Segments
pub fn iter(&self) -> impl Iterator<Item = &ErasedSegment>
pub fn recursive_crawl(&self, seg_type: &[&str], recurse_into: bool) -> Segments
pub fn iterate_segments(&self) -> impl Iterator<Item = Segments> + '_
pub fn from_vec( base: Vec<ErasedSegment>, templated_file: Option<TemplatedFile> ) -> Self
pub fn reversed(&self) -> Self
pub fn get( &self, index: usize, default: Option<ErasedSegment> ) -> Option<ErasedSegment>
pub fn first(&self) -> Option<&ErasedSegment>
pub fn last(&self) -> Option<&ErasedSegment>
pub fn pop(&mut self) -> ErasedSegment
pub fn all(&self, predicate: Option<fn(_: &ErasedSegment) -> bool>) -> bool
pub fn any(&self, predicate: Option<fn(_: &ErasedSegment) -> bool>) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn new( segment: ErasedSegment, templated_file: Option<TemplatedFile> ) -> Self
pub fn children( &self, predicate: Option<fn(_: &ErasedSegment) -> bool> ) -> Segments
pub fn find_last( &self, predicate: Option<fn(_: &ErasedSegment) -> bool> ) -> Segments
pub fn find(&self, value: &ErasedSegment) -> Option<usize>
pub fn find_first<F: Fn(&ErasedSegment) -> bool>( &self, predicate: Option<F> ) -> Segments
pub fn index(&self, value: &ErasedSegment) -> Option<usize>
pub fn select( &self, select_if: Option<fn(_: &ErasedSegment) -> bool>, loop_while: Option<fn(_: &ErasedSegment) -> bool>, start_seg: Option<&ErasedSegment>, stop_seg: Option<&ErasedSegment> ) -> Segments
Trait Implementations§
source§impl<I: SliceIndex<[ErasedSegment]>> Index<I> for Segments
impl<I: SliceIndex<[ErasedSegment]>> Index<I> for Segments
§type Output = <I as SliceIndex<[ErasedSegment]>>::Output
type Output = <I as SliceIndex<[ErasedSegment]>>::Output
The returned type after indexing.
source§impl IntoIterator for Segments
impl IntoIterator for Segments
Auto Trait Implementations§
impl Freeze for Segments
impl !RefUnwindSafe for Segments
impl Send for Segments
impl Sync for Segments
impl Unpin for Segments
impl !UnwindSafe for Segments
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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