pub enum Fragment {
None,
Statement {
text: Arc<str>,
line: StatementLine,
column: StatementColumn,
},
Internal {
text: Arc<str>,
},
}Expand description
Fragment - owns all its data
Variants§
None
No fragment information available
Statement
Fragment from a RQL statement with position information
Internal
Fragment from internal/runtime code
Implementations§
Source§impl Fragment
impl Fragment
Sourcepub fn line(&self) -> StatementLine
pub fn line(&self) -> StatementLine
Get line position
Sourcepub fn column(&self) -> StatementColumn
pub fn column(&self) -> StatementColumn
Get column position
Sourcepub fn sub_fragment(&self, offset: usize, length: usize) -> Fragment
pub fn sub_fragment(&self, offset: usize, length: usize) -> Fragment
Get a sub-fragment starting at the given offset with the given length
Source§impl Fragment
impl Fragment
Sourcepub fn internal(text: impl AsRef<str>) -> Self
pub fn internal(text: impl AsRef<str>) -> Self
Create an internal fragment - useful for creating fragments from substrings.
Takes impl AsRef<str> so Arc::<str>::from(&str) allocates the
inline Arc payload directly, skipping the implicit String round
trip that the previous impl Into<String> signature forced.
Sourcepub fn testing(text: impl AsRef<str>) -> Self
pub fn testing(text: impl AsRef<str>) -> Self
Create a testing fragment - returns a Statement fragment for test purposes.
Takes impl AsRef<str> so Arc::<str>::from(&str) allocates the
inline Arc payload directly, skipping the implicit String round
trip that the previous impl Into<String> signature forced.
Sourcepub fn testing_empty() -> Self
pub fn testing_empty() -> Self
Create an empty testing fragment
Sourcepub fn merge_all(fragments: impl IntoIterator<Item = Fragment>) -> Fragment
pub fn merge_all(fragments: impl IntoIterator<Item = Fragment>) -> Fragment
Merge multiple fragments (in any order) into one encompassing fragment
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fragment
impl<'de> Deserialize<'de> for Fragment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Ord for Fragment
impl Ord for Fragment
Source§impl PartialOrd for Fragment
impl PartialOrd for Fragment
impl Eq for Fragment
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl Freeze for Fragment
impl RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnsafeUnpin for Fragment
impl UnwindSafe for Fragment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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