Struct oxrdf::VariableRef
source · 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::{VariableRef, VariableNameParseError};
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<Self, VariableNameParseError>
pub fn new(name: &'a str) -> Result<Self, VariableNameParseError>
Creates a variable name from a unique identifier.
The variable identifier must be valid according to the SPARQL grammar.
sourcepub fn new_unchecked(name: &'a str) -> Self
pub fn new_unchecked(name: &'a str) -> Self
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 fn as_str(&self) -> &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§impl<'a> From<VariableRef<'a>> for Variable
impl<'a> From<VariableRef<'a>> for Variable
source§fn from(variable: VariableRef<'a>) -> Self
fn from(variable: VariableRef<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Hash for VariableRef<'a>
impl<'a> Hash for VariableRef<'a>
source§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§fn eq(&self, other: &VariableRef<'_>) -> bool
fn eq(&self, other: &VariableRef<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<VariableRef<'a>> for VariableRef<'a>
impl<'a> PartialEq<VariableRef<'a>> for VariableRef<'a>
source§fn eq(&self, other: &VariableRef<'a>) -> bool
fn eq(&self, other: &VariableRef<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Variable> for VariableRef<'_>
impl PartialOrd<Variable> for VariableRef<'_>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<VariableRef<'_>> for Variable
impl PartialOrd<VariableRef<'_>> for Variable
source§fn partial_cmp(&self, other: &VariableRef<'_>) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableRef<'_>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> PartialOrd<VariableRef<'a>> for VariableRef<'a>
impl<'a> PartialOrd<VariableRef<'a>> for VariableRef<'a>
source§fn partial_cmp(&self, other: &VariableRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableRef<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Copy for VariableRef<'a>
impl<'a> Eq for VariableRef<'a>
impl<'a> StructuralEq for VariableRef<'a>
impl<'a> StructuralPartialEq for VariableRef<'a>
Auto Trait Implementations§
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