Struct PointerBuf

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

An owned, mutable Pointer (akin to String).

This type provides methods like PointerBuf::push_back and PointerBuf::replace that mutate the pointer in place. It also implements core::ops::Deref to Pointer, meaning that all methods on Pointer slices are available on PointerBuf values as well.

Implementations§

Source§

impl PointerBuf

Source

pub fn new() -> PointerBuf

Creates a new PointerBuf pointing to a document root.

Source

pub fn parse<S>(s: &S) -> Result<PointerBuf, ParseError>
where S: AsRef<str> + ?Sized,

Attempts to parse a string into a PointerBuf.

§Errors

Returns a ParseError if the string is not a valid JSON Pointer.

Source

pub fn from_tokens<'a, T>(tokens: impl IntoIterator<Item = T>) -> PointerBuf
where T: Into<Token<'a>>,

Creates a new PointerBuf from a slice of non-encoded strings.

Source

pub fn as_ptr(&self) -> &Pointer

Coerces to a Pointer slice.

Source

pub fn push_front<'t>(&mut self, token: impl Into<Token<'t>>)

Pushes a Token onto the front of this Pointer.

Source

pub fn push_back<'t>(&mut self, token: impl Into<Token<'t>>)

Pushes a Token onto the back of this Pointer.

Source

pub fn pop_back(&mut self) -> Option<Token<'static>>

Removes and returns the last Token in the Pointer if it exists.

Source

pub fn pop_front(&mut self) -> Option<Token<'static>>

Removes and returns the first Token in the Pointer if it exists.

Source

pub fn append<P>(&mut self, other: P) -> &PointerBuf
where P: AsRef<Pointer>,

Merges two Pointers by appending other onto self.

Source

pub fn replace<'t>( &mut self, index: usize, token: impl Into<Token<'t>>, ) -> Result<Option<Token<'_>>, ReplaceError>

Attempts to replace a Token by the index, returning the replaced Token if it already exists. Returns None otherwise.

§Errors

A [ReplaceError] is returned if the index is out of bounds.

Source

pub fn clear(&mut self)

Clears the Pointer, setting it to root ("").

Methods from Deref<Target = Pointer>§

Source

pub fn as_str(&self) -> &str

The encoded string representation of this Pointer

Source

pub fn to_buf(&self) -> PointerBuf

Converts into an owned PointerBuf

Source

pub fn tokens(&self) -> Tokens<'_>

Returns an iterator of Tokens in the Pointer.

Source

pub fn count(&self) -> usize

Returns the number of tokens in the Pointer.

Source

pub fn is_root(&self) -> bool

Returns true if the JSON Pointer equals "".

Source

pub fn to_json_value(&self) -> Value

Returns a serde_json::Value representation of this Pointer

Source

pub fn back(&self) -> Option<Token<'_>>

Returns the last Token in the Pointer.

Source

pub fn last(&self) -> Option<Token<'_>>

Returns the last token in the Pointer.

alias for back

Source

pub fn front(&self) -> Option<Token<'_>>

Returns the first Token in the Pointer.

Source

pub fn first(&self) -> Option<Token<'_>>

Returns the first Token in the Pointer.

alias for front

Source

pub fn split_front(&self) -> Option<(Token<'_>, &Pointer)>

Splits the Pointer into the first Token and a remainder Pointer.

Source

pub fn split_at(&self, offset: usize) -> Option<(&Pointer, &Pointer)>

Splits the Pointer at the given index if the character at the index is a separator backslash ('/'), returning Some((head, tail)). Otherwise, returns None.

For the following JSON Pointer, the following splits are possible (0, 4, 8):

/foo/bar/baz
↑   ↑   ↑
0   4   8

All other indices will return None.

§Example
let ptr = Pointer::from_static("/foo/bar/baz");
let (head, tail) = ptr.split_at(4).unwrap();
assert_eq!(head, Pointer::from_static("/foo"));
assert_eq!(tail, Pointer::from_static("/bar/baz"));
assert_eq!(ptr.split_at(3), None);
Source

pub fn split_back(&self) -> Option<(&Pointer, Token<'_>)>

Splits the Pointer into the parent path and the last Token.

Source

pub fn parent(&self) -> Option<&Pointer>

A pointer to the parent of the current path.

Source

pub fn strip_suffix<'a>(&'a self, suffix: &Pointer) -> Option<&'a Pointer>

Returns the pointer stripped of the given suffix.

Source

pub fn strip_prefix<'a>(&'a self, prefix: &Pointer) -> Option<&'a Pointer>

Returns the pointer stripped of the given prefix.

Source

pub fn get(&self, index: usize) -> Option<Token<'_>>

Attempts to get a Token by the index. Returns None if the index is out of bounds.

§Example
use jsonptr::{Pointer, Token};

let ptr = Pointer::from_static("/foo/bar");
assert_eq!(ptr.get(0), Some("foo".into()));
assert_eq!(ptr.get(1), Some("bar".into()));
assert_eq!(ptr.get(2), None);

let ptr = Pointer::root();
assert_eq!(ptr.get(0), None);
Source

pub fn resolve<'v, R>( &self, value: &'v R, ) -> Result<&'v <R as Resolve>::Value, <R as Resolve>::Error>
where R: Resolve,

Attempts to resolve a R::Value based on the path in this Pointer.

§Errors

Returns R::Error if an error occurs while resolving.

The rules of such are determined by the R’s implementation of Resolve but provided implementations return ResolveError if:

  • The path is unreachable (e.g. a scalar is encountered prior to the end of the path)
  • The path is not found (e.g. a key in an object or an index in an array does not exist)
  • A Token cannot be parsed as an array Index
  • An array Index is out of bounds
Source

pub fn resolve_mut<'v, R>( &self, value: &'v mut R, ) -> Result<&'v mut <R as ResolveMut>::Value, <R as ResolveMut>::Error>
where R: ResolveMut,

Attempts to resolve a mutable R::Value based on the path in this Pointer.

§Errors

Returns R::Error if an error occurs while resolving.

The rules of such are determined by the R’s implementation of ResolveMut but provided implementations return ResolveError if:

  • The path is unreachable (e.g. a scalar is encountered prior to the end of the path)
  • The path is not found (e.g. a key in an object or an index in an array does not exist)
  • A Token cannot be parsed as an array Index
  • An array Index is out of bounds
Source

pub fn intersection<'a>(&'a self, other: &Pointer) -> &'a Pointer

Finds the commonality between this and another Pointer.

Source

pub fn delete<D>(&self, value: &mut D) -> Option<<D as Delete>::Value>
where D: Delete,

Attempts to delete a serde_json::Value based upon the path in this Pointer.

The rules of deletion are determined by the D’s implementation of Delete. The supplied implementations ("json" & "toml") operate as follows:

  • If the Pointer can be resolved, the Value is deleted and returned.
  • If the Pointer fails to resolve for any reason, Ok(None) is returned.
  • If the Pointer is root, value is replaced:
    • "json": serde_json::Value::Null
    • "toml": toml::Value::Table::Default
§Examples
§Deleting a resolved pointer:
use jsonptr::{Pointer, delete::Delete};
use serde_json::json;

let mut data = json!({ "foo": { "bar": { "baz": "qux" } } });
let ptr = Pointer::from_static("/foo/bar/baz");
assert_eq!(data.delete(&ptr), Some("qux".into()));
assert_eq!(data, json!({ "foo": { "bar": {} } }));
§Deleting a non-existent Pointer returns None:
use jsonptr::{ Pointer, delete::Delete };
use serde_json::json;

let mut data = json!({});
let ptr = Pointer::from_static("/foo/bar/baz");
assert_eq!(ptr.delete(&mut data), None);
assert_eq!(data, json!({}));
§Deleting a root pointer replaces the value with Value::Null:
use jsonptr::{Pointer, delete::Delete};
use serde_json::json;

let mut data = json!({ "foo": { "bar": "baz" } });
let ptr = Pointer::root();
assert_eq!(data.delete(&ptr), Some(json!({ "foo": { "bar": "baz" } })));
assert!(data.is_null());
Source

pub fn assign<D, V>( &self, dest: &mut D, src: V, ) -> Result<Option<<D as Assign>::Value>, <D as Assign>::Error>
where D: Assign, V: Into<<D as Assign>::Value>,

Attempts to assign src to dest based on the path in this Pointer.

If the path is partially available, the missing portions will be created. If the path contains a zero index, such as "/0", then an array will be created. Otherwise, objects will be utilized to create the missing path.

§Example
use jsonptr::Pointer;
use serde_json::{json, Value};

let mut data = json!([]);
let mut ptr = Pointer::from_static("/0/foo");
let replaced = ptr.assign(&mut data, json!("bar")).unwrap();
assert_eq!(data, json!([{"foo": "bar"}]));
assert_eq!(replaced, None);
§Errors

Returns Assign::Error if the path is invalid or if the value cannot be assigned.

Source

pub fn components(&self) -> Components<'_>

Returns Components of this JSON Pointer.

A Component is either Token or the root location of a document.

§Example
let ptr = Pointer::parse("/a/b").unwrap();
let mut components = ptr.components();
assert_eq!(components.next(), Some(Component::Root));
assert_eq!(components.next(), Some(Component::Token("a".into())));
assert_eq!(components.next(), Some(Component::Token("b".into())));
assert_eq!(components.next(), None);
Source

pub fn with_trailing_token<'t>(&self, token: impl Into<Token<'t>>) -> PointerBuf

Creates an owned PointerBuf like self but with token appended.

See PointerBuf::push_back for more details.

Note: this method allocates. If you find yourself calling it more than once for a given pointer, consider using PointerBuf::push_back instead.

§Examples
let ptr = jsonptr::Pointer::from_static("/foo");
let foobar = ptr.with_trailing_token("bar");
assert_eq!(foobar, "/foo/bar");
Source

pub fn with_leading_token<'t>(&self, token: impl Into<Token<'t>>) -> PointerBuf

Creates an owned PointerBuf like self but with token prepended.

See PointerBuf::push_front for more details.

Note: this method allocates. If you find yourself calling it more than once for a given pointer, consider using PointerBuf::push_front instead.

§Examples
let ptr = jsonptr::Pointer::from_static("/bar");
let foobar = ptr.with_leading_token("foo");
assert_eq!(foobar, "/foo/bar");
Source

pub fn concat(&self, other: &Pointer) -> PointerBuf

Creates an owned PointerBuf like self but with other appended to the end.

See PointerBuf::append for more details.

Note: this method allocates. If you find yourself calling it more than once for a given pointer, consider using PointerBuf::append instead.

§Examples
let ptr = jsonptr::Pointer::from_static("/foo");
let other = jsonptr::Pointer::from_static("/bar/baz");
assert_eq!(ptr.concat(other), "/foo/bar/baz");
Source

pub fn len(&self) -> usize

This length expresses the byte count of the underlying string that represents the RFC 6091 Pointer. See also [std::str::len].

§Examples
let mut ptr = jsonptr::Pointer::from_static("/foo/bar").to_buf();
assert_eq!(ptr.len(), 8);

ptr.push_back("~");
assert_eq!(ptr.len(), 11);
Source

pub fn is_empty(&self) -> bool

Returns true if the Pointer is empty (i.e. root).

§Examples
let mut ptr = jsonptr::PointerBuf::new();
assert!(ptr.is_empty());

ptr.push_back("foo");
assert!(!ptr.is_empty());

Trait Implementations§

Source§

impl AsRef<Pointer> for PointerBuf

Source§

fn as_ref(&self) -> &Pointer

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

impl Borrow<Pointer> for PointerBuf

Source§

fn borrow(&self) -> &Pointer

Immutably borrows from an owned value. Read more
Source§

impl Clone for PointerBuf

Source§

fn clone(&self) -> PointerBuf

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PointerBuf

Source§

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

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

impl Default for PointerBuf

Source§

fn default() -> PointerBuf

Returns the “default value” for a type. Read more
Source§

impl Deref for PointerBuf

Source§

type Target = Pointer

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<PointerBuf as Deref>::Target

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for PointerBuf

Source§

fn deserialize<D>( deserializer: D, ) -> Result<PointerBuf, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for PointerBuf

Source§

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

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

impl From<Token<'_>> for PointerBuf

Source§

fn from(t: Token<'_>) -> PointerBuf

Converts to this type from the input type.
Source§

impl From<usize> for PointerBuf

Source§

fn from(value: usize) -> PointerBuf

Converts to this type from the input type.
Source§

impl FromStr for PointerBuf

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<PointerBuf, <PointerBuf as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for PointerBuf

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> IntoIterator for &'a PointerBuf

Source§

type Item = Token<'a>

The type of the elements being iterated over.
Source§

type IntoIter = Tokens<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a PointerBuf as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl Ord for PointerBuf

Source§

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

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

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<&Pointer> for PointerBuf

Source§

fn eq(&self, other: &&Pointer) -> 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 PartialEq<&str> for PointerBuf

Source§

fn eq(&self, other: &&str) -> 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 PartialEq<Pointer> for PointerBuf

Source§

fn eq(&self, other: &Pointer) -> 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 PartialEq<PointerBuf> for &Pointer

Source§

fn eq(&self, other: &PointerBuf) -> 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 PartialEq<PointerBuf> for &str

Source§

fn eq(&self, other: &PointerBuf) -> 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 PartialEq<PointerBuf> for Pointer

Source§

fn eq(&self, other: &PointerBuf) -> 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 PartialEq<PointerBuf> for str

Source§

fn eq(&self, other: &PointerBuf) -> 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 PartialEq<String> for PointerBuf

Source§

fn eq(&self, other: &String) -> 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 PartialEq<str> for PointerBuf

Source§

fn eq(&self, other: &str) -> 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 PartialEq for PointerBuf

Source§

fn eq(&self, other: &PointerBuf) -> 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<&Pointer> for PointerBuf

Source§

fn partial_cmp(&self, other: &&Pointer) -> 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 PartialOrd<&str> for PointerBuf

Source§

fn partial_cmp(&self, other: &&str) -> 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 PartialOrd<Pointer> for PointerBuf

Source§

fn partial_cmp(&self, other: &Pointer) -> 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<'p> PartialOrd<PointerBuf> for &'p Pointer

Source§

fn partial_cmp(&self, other: &PointerBuf) -> 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 PartialOrd<PointerBuf> for &str

Source§

fn partial_cmp(&self, other: &PointerBuf) -> 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 PartialOrd<PointerBuf> for Pointer

Source§

fn partial_cmp(&self, other: &PointerBuf) -> 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 PartialOrd<PointerBuf> for str

Source§

fn partial_cmp(&self, other: &PointerBuf) -> 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 PartialOrd<String> for PointerBuf

Source§

fn partial_cmp(&self, other: &String) -> 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 PartialOrd for PointerBuf

Source§

fn partial_cmp(&self, other: &PointerBuf) -> 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 PointerBuf

Source§

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
Source§

impl TryFrom<&str> for PointerBuf

Source§

type Error = ParseError

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

fn try_from( value: &str, ) -> Result<PointerBuf, <PointerBuf as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl TryFrom<String> for PointerBuf

Source§

type Error = ParseError

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

fn try_from( value: String, ) -> Result<PointerBuf, <PointerBuf as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl Eq for PointerBuf

Source§

impl StructuralPartialEq for PointerBuf

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,