pub enum OwnedFragment {
None,
Statement {
text: String,
line: StatementLine,
column: StatementColumn,
},
Internal {
text: String,
},
}Expand description
Owned 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 OwnedFragment
impl OwnedFragment
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 into_owned(self) -> OwnedFragment
pub fn into_owned(self) -> OwnedFragment
Convert to owned variant
Sourcepub fn sub_fragment(&self, offset: usize, length: usize) -> OwnedFragment
pub fn sub_fragment(&self, offset: usize, length: usize) -> OwnedFragment
Get a sub-fragment starting at the given offset with the given length
Source§impl OwnedFragment
impl OwnedFragment
Sourcepub fn internal(text: impl Into<String>) -> OwnedFragment
pub fn internal(text: impl Into<String>) -> OwnedFragment
Create an internal fragment - useful for creating fragments from substrings
Sourcepub fn testing(text: impl Into<String>) -> OwnedFragment
pub fn testing(text: impl Into<String>) -> OwnedFragment
Create a testing fragment - returns a Statement fragment for test purposes
Sourcepub fn testing_empty() -> OwnedFragment
pub fn testing_empty() -> OwnedFragment
Create an empty testing fragment
Sourcepub fn merge_all(
fragments: impl IntoIterator<Item = OwnedFragment>,
) -> OwnedFragment
pub fn merge_all( fragments: impl IntoIterator<Item = OwnedFragment>, ) -> OwnedFragment
Merge multiple fragments (in any order) into one encompassing fragment
Trait Implementations§
Source§impl AsRef<str> for OwnedFragment
impl AsRef<str> for OwnedFragment
Source§impl Clone for OwnedFragment
impl Clone for OwnedFragment
Source§fn clone(&self) -> OwnedFragment
fn clone(&self) -> OwnedFragment
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 Debug for OwnedFragment
impl Debug for OwnedFragment
Source§impl Default for OwnedFragment
impl Default for OwnedFragment
Source§fn default() -> OwnedFragment
fn default() -> OwnedFragment
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OwnedFragment
impl<'de> Deserialize<'de> for OwnedFragment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedFragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedFragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OwnedFragment
impl Display for OwnedFragment
Source§impl From<Option<OwnedFragment>> for OwnedFragment
impl From<Option<OwnedFragment>> for OwnedFragment
Source§fn from(fragment_opt: Option<OwnedFragment>) -> OwnedFragment
fn from(fragment_opt: Option<OwnedFragment>) -> OwnedFragment
Converts to this type from the input type.
Source§impl Hash for OwnedFragment
impl Hash for OwnedFragment
Source§impl IntoFragment<'_> for OwnedFragment
impl IntoFragment<'_> for OwnedFragment
fn into_fragment(self) -> Fragment<'static>
Source§impl IntoFragment<'static> for &OwnedFragment
impl IntoFragment<'static> for &OwnedFragment
fn into_fragment(self) -> Fragment<'static>
Source§impl Ord for OwnedFragment
impl Ord for OwnedFragment
Source§fn cmp(&self, other: &OwnedFragment) -> Ordering
fn cmp(&self, other: &OwnedFragment) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OwnedFragment
impl PartialEq for OwnedFragment
Source§impl PartialOrd for OwnedFragment
impl PartialOrd for OwnedFragment
Source§impl Serialize for OwnedFragment
impl Serialize for OwnedFragment
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 OwnedFragment
impl StructuralPartialEq for OwnedFragment
Auto Trait Implementations§
impl Freeze for OwnedFragment
impl RefUnwindSafe for OwnedFragment
impl Send for OwnedFragment
impl Sync for OwnedFragment
impl Unpin for OwnedFragment
impl UnwindSafe for OwnedFragment
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