Struct AttributeRef

Source
pub struct AttributeRef(/* private fields */);
Expand description

A borrowing version of Attribute, like Path is to PathBuf.

Implementations§

Source§

impl AttributeRef

Source

pub fn from_str<S: AsRef<str> + ?Sized>( s: &S, ) -> Result<&Self, AttributeParseError>

TODO needs a better name so this doesn’t collide with FromStr.

Source

pub fn just_the_identifier(&self) -> &str

Without the leading :.

Source

pub fn as_str(&self) -> &str

The identifier with the leading :.

Source

pub fn tail(&self) -> &str

Everything after the last / in the identifier, or just the identifier if no / is in the attribute.

Source§

impl AttributeRef

Source

pub fn from_static(s: &'static str) -> &'static Self

Panics if the attribute is invalid

Trait Implementations§

Source§

impl AsRef<AttributeRef> for &AttributeRef

Source§

fn as_ref(&self) -> &AttributeRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<AttributeRef> for Attribute

Source§

fn as_ref(&self) -> &AttributeRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AttributeRef> for Attribute

Source§

fn borrow(&self) -> &AttributeRef

Immutably borrows from an owned value. Read more
Source§

impl Debug for AttributeRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AttributeRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a AttributeRef> for ValueRef<'a>

Source§

fn from(v: &'a AttributeRef) -> Self

Converts to this type from the input type.
Source§

impl Ord for AttributeRef

Source§

fn cmp(&self, other: &AttributeRef) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for AttributeRef

Source§

fn eq(&self, other: &AttributeRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for AttributeRef

Source§

fn partial_cmp(&self, other: &AttributeRef) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for AttributeRef

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToOwned for AttributeRef

Source§

type Owned = Attribute

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<'a> ToSql for &'a AttributeRef

Source§

fn to_sql(&self) -> Result<ToSqlOutput<'_>>

Converts Rust value to SQLite value
Source§

impl<'a> TryFrom<&'a str> for &'a AttributeRef

Source§

type Error = AttributeParseError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TypeTag for &AttributeRef

Source§

type Factory = Attribute

Used to help map borrowing and owning instances to a single type. To avoid discriminating between &Value, Value, and ValueRef in cases where we want to treat them the same. Read more
Source§

fn type_tag(&self) -> i64

Source§

impl Eq for AttributeRef

Source§

impl StructuralPartialEq for AttributeRef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more