pub struct VariableRef<'a> { /* private fields */ }
Expand description
A SPARQL query borrowed variable.
The default string formatter is returning a SPARQL compatible representation:
use oxrdf::{VariableNameParseError, VariableRef};
assert_eq!("?foo", VariableRef::new("foo")?.to_string());
Implementations§
Source§impl<'a> VariableRef<'a>
impl<'a> VariableRef<'a>
Sourcepub fn new(name: &'a str) -> Result<VariableRef<'a>, VariableNameParseError>
pub fn new(name: &'a str) -> Result<VariableRef<'a>, VariableNameParseError>
Creates a variable name from a unique identifier.
The variable identifier must be valid according to the SPARQL grammar.
Sourcepub const fn new_unchecked(name: &'a str) -> VariableRef<'a>
pub const fn new_unchecked(name: &'a str) -> VariableRef<'a>
Creates a variable name from a unique identifier without validation.
It is the caller’s responsibility to ensure that id
is a valid blank node identifier
according to the SPARQL grammar.
Variable::new()
is a safe version of this constructor and should be used for untrusted data.
pub const fn as_str(self) -> &'a str
pub fn into_string(self) -> String
pub fn into_owned(self) -> Variable
Trait Implementations§
Source§impl<'a> Clone for VariableRef<'a>
impl<'a> Clone for VariableRef<'a>
Source§fn clone(&self) -> VariableRef<'a>
fn clone(&self) -> VariableRef<'a>
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> Debug for VariableRef<'a>
impl<'a> Debug for VariableRef<'a>
Source§impl Display for VariableRef<'_>
impl Display for VariableRef<'_>
Source§impl<'a> From<&'a Variable> for VariableRef<'a>
impl<'a> From<&'a Variable> for VariableRef<'a>
Source§fn from(variable: &'a Variable) -> VariableRef<'a>
fn from(variable: &'a Variable) -> VariableRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<VariableRef<'a>> for Variable
impl<'a> From<VariableRef<'a>> for Variable
Source§fn from(variable: VariableRef<'a>) -> Variable
fn from(variable: VariableRef<'a>) -> Variable
Converts to this type from the input type.
Source§impl<'a> Hash for VariableRef<'a>
impl<'a> Hash for VariableRef<'a>
Source§impl Index<VariableRef<'_>> for QuerySolution
impl Index<VariableRef<'_>> for QuerySolution
Source§fn index(
&self,
index: VariableRef<'_>,
) -> &<QuerySolution as Index<VariableRef<'_>>>::Output
fn index( &self, index: VariableRef<'_>, ) -> &<QuerySolution as Index<VariableRef<'_>>>::Output
Performs the indexing (
container[index]
) operation. Read moreSource§impl<'a> Ord for VariableRef<'a>
impl<'a> Ord for VariableRef<'a>
Source§fn cmp(&self, other: &VariableRef<'a>) -> Ordering
fn cmp(&self, other: &VariableRef<'a>) -> 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<Variable> for VariableRef<'_>
impl PartialEq<Variable> for VariableRef<'_>
Source§impl PartialEq<VariableRef<'_>> for Variable
impl PartialEq<VariableRef<'_>> for Variable
Source§impl<'a> PartialEq for VariableRef<'a>
impl<'a> PartialEq for VariableRef<'a>
Source§impl PartialOrd<Variable> for VariableRef<'_>
impl PartialOrd<Variable> for VariableRef<'_>
Source§impl PartialOrd<VariableRef<'_>> for Variable
impl PartialOrd<VariableRef<'_>> for Variable
Source§impl<'a> PartialOrd for VariableRef<'a>
impl<'a> PartialOrd for VariableRef<'a>
Source§impl VariableSolutionIndex for VariableRef<'_>
impl VariableSolutionIndex for VariableRef<'_>
impl<'a> Copy for VariableRef<'a>
impl<'a> Eq for VariableRef<'a>
impl<'a> StructuralPartialEq for VariableRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for VariableRef<'a>
impl<'a> RefUnwindSafe for VariableRef<'a>
impl<'a> Send for VariableRef<'a>
impl<'a> Sync for VariableRef<'a>
impl<'a> Unpin for VariableRef<'a>
impl<'a> UnwindSafe for VariableRef<'a>
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