Struct rob::Rob [] [src]

pub struct Rob<'a, T: 'a + ?Sized> { /* fields omitted */ }

The Rob type. See the crate documentation.

Methods

impl<'a, T: 'a> Rob<'a, T>
[src]

[src]

Creates a new Rob with an owned value.

Example

let x = rob::Rob::from_value(123i32);
assert_eq!(*x, 123);
assert!(rob::Rob::is_owned(&x));

impl<'a, T: 'a + ?Sized> Rob<'a, T>
[src]

[src]

Creates a new Rob with a borrowed reference.

Example

let value = 123i32;
let x = rob::Rob::from_ref(&value);
assert_eq!(*x, 123);
assert!(!rob::Rob::is_owned(&x));

[src]

Creates a new Rob with an owned value that is already boxed.

Example

let x = rob::Rob::from_box(Box::new(123i32));
assert_eq!(*x, 123);
assert!(rob::Rob::is_owned(&x));

[src]

Creates a new Rob from a raw pointer and an owned flag. If is_owned is true, ptr should come from Box::into_raw.

[src]

Consumes this, returning a raw pointer to the value and a flag indicating whether the values is owned or not.

[src]

If the value is not owned, returns a reference to it with lifetime 'a.

[src]

Returns whether the value is owned or not.

impl<'a, T: 'a + ?Sized> Rob<'a, T> where
    T: ToOwned,
    <T as ToOwned>::Owned: Into<Box<T>>, 
[src]

[src]

Consumes this, returning a Box containing the value, cloning it if it was not owned.

[src]

Returns a mutable reference to the value, cloning it if it was not owned.

Trait Implementations

impl<'a, T: 'a + ?Sized> Drop for Rob<'a, T>
[src]

[src]

Executes the destructor for this type. Read more

impl<'a, T: 'a> From<T> for Rob<'a, T>
[src]

[src]

Performs the conversion.

impl<'a, T: 'a + ?Sized> From<&'a T> for Rob<'a, T>
[src]

[src]

Performs the conversion.

impl<'a, T: 'a + ?Sized> From<Box<T>> for Rob<'a, T>
[src]

[src]

Performs the conversion.

impl<'a, T: 'a> From<Vec<T>> for Rob<'a, [T]>
[src]

[src]

Performs the conversion.

impl<'a> From<String> for Rob<'a, str>
[src]

[src]

Performs the conversion.

impl<'a> From<CString> for Rob<'a, CStr>
[src]

[src]

Performs the conversion.

impl<'a> From<OsString> for Rob<'a, OsStr>
[src]

[src]

Performs the conversion.

impl<'a> From<PathBuf> for Rob<'a, Path>
[src]

[src]

Performs the conversion.

impl<'a, T> From<Cow<'a, T>> for Rob<'a, T> where
    T: ToOwned,
    <T as ToOwned>::Owned: Into<Box<T>>, 
[src]

[src]

Performs the conversion.

impl<'a, T: 'a + Clone> Clone for Rob<'a, T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a, T: 'a + ?Sized + Debug> Debug for Rob<'a, T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, T: 'a + ?Sized + Hash> Hash for Rob<'a, T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a, T: 'a + ?Sized + PartialEq> PartialEq for Rob<'a, T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'a, T: 'a + ?Sized + PartialOrd> PartialOrd for Rob<'a, T>
[src]

[src]

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

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

impl<'a, T: 'a + ?Sized> Deref for Rob<'a, T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<'a, T: 'a + ?Sized> Borrow<T> for Rob<'a, T>
[src]

[src]

Immutably borrows from an owned value. Read more

impl<'a, T: 'a + ?Sized> AsRef<T> for Rob<'a, T>
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl<'a, T> !Send for Rob<'a, T>

impl<'a, T> !Sync for Rob<'a, T>