[][src]Struct rustc_data_structures::stable_hasher::StableVec

pub struct StableVec<T>(_);

A vector container that makes sure that its items are hashed in a stable order.

Methods

impl<T> StableVec<T>[src]

pub fn new(v: Vec<T>) -> Self[src]

Methods from Deref<Target = Vec<T>>

pub fn capacity(&self) -> usize
1.0.0
[src]

Returns the number of elements the vector can hold without reallocating.

Examples

let vec: Vec<i32> = Vec::with_capacity(10);
assert_eq!(vec.capacity(), 10);

Important traits for &'a mut [u8]
pub fn as_slice(&self) -> &[T]
1.7.0
[src]

Extracts a slice containing the entire vector.

Equivalent to &s[..].

Examples

use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];
io::sink().write(buffer.as_slice()).unwrap();

pub fn len(&self) -> usize
1.0.0
[src]

Returns the number of elements in the vector, also referred to as its 'length'.

Examples

let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);

pub fn is_empty(&self) -> bool
1.0.0
[src]

Returns true if the vector contains no elements.

Examples

let mut v = Vec::new();
assert!(v.is_empty());

v.push(1);
assert!(!v.is_empty());

Trait Implementations

impl<T, HCX> HashStable<HCX> for StableVec<T> where
    T: HashStable<HCX> + ToStableHashKey<HCX>, 
[src]

impl<T> Deref for StableVec<T>[src]

type Target = Vec<T>

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> Send for StableVec<T> where
    T: Send

impl<T> Sync for StableVec<T> where
    T: Sync

Blanket Implementations

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<T> Erased for T