pub enum Fragment {
None,
Statement {
text: Arc<String>,
line: StatementLine,
column: StatementColumn,
},
Internal {
text: Arc<String>,
},
}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 Into<String>) -> Fragment
pub fn internal(text: impl Into<String>) -> Fragment
Create an internal fragment - useful for creating fragments from substrings
Sourcepub fn testing(text: impl Into<String>) -> Fragment
pub fn testing(text: impl Into<String>) -> Fragment
Create a testing fragment - returns a Statement fragment for test purposes
Sourcepub fn testing_empty() -> Fragment
pub fn testing_empty() -> Fragment
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<Fragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Fragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Fragment
impl Ord for Fragment
Source§impl PartialOrd for Fragment
impl PartialOrd for Fragment
Source§impl Serialize for Fragment
impl Serialize for Fragment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 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
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<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
Compare self to
key and return true if they are equal.