(function() { var type_impls = Object.fromEntries([["mito2",[["
§

impl<A> AsMut<[<A as Array>::Item]> for SmallVec<A>
where\n A: Array,

§

fn as_mut(&mut self) -> &mut [<A as Array>::Item]

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut<[::Item]>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> AsRef<[<A as Array>::Item]> for SmallVec<A>
where\n A: Array,

§

fn as_ref(&self) -> &[<A as Array>::Item]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[::Item]>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Borrow<[<A as Array>::Item]> for SmallVec<A>
where\n A: Array,

§

fn borrow(&self) -> &[<A as Array>::Item]

Immutably borrows from an owned value. Read more
","Borrow<[::Item]>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> BorrowMut<[<A as Array>::Item]> for SmallVec<A>
where\n A: Array,

§

fn borrow_mut(&mut self) -> &mut [<A as Array>::Item]

Mutably borrows from an owned value. Read more
","BorrowMut<[::Item]>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Clone for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Clone,

§

fn clone(&self) -> SmallVec<A>

Returns a duplicate of the value. Read more
§

fn clone_from(&mut self, source: &SmallVec<A>)

Performs copy-assignment from source. Read more
","Clone","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Debug for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Debug,

§

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

Formats the value using the given formatter. Read more
","Debug","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Default for SmallVec<A>
where\n A: Array,

§

fn default() -> SmallVec<A>

Returns the “default value” for a type. Read more
","Default","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> DerefMut for SmallVec<A>
where\n A: Array,

§

fn deref_mut(&mut self) -> &mut [<A as Array>::Item]

Mutably dereferences the value.
","DerefMut","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<'de, A> Deserialize<'de> for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Deserialize<'de>,

§

fn deserialize<D>(\n deserializer: D,\n) -> Result<SmallVec<A>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Drop for SmallVec<A>
where\n A: Array,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Extend<<A as Array>::Item> for SmallVec<A>
where\n A: Array,

§

fn extend<I>(&mut self, iterable: I)
where\n I: IntoIterator<Item = <A as Array>::Item>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<::Item>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<'a, A> From<&'a [<A as Array>::Item]> for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Clone,

§

fn from(slice: &'a [<A as Array>::Item]) -> SmallVec<A>

Converts to this type from the input type.
","From<&'a [::Item]>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> From<A> for SmallVec<A>
where\n A: Array,

§

fn from(array: A) -> SmallVec<A>

Converts to this type from the input type.
","From","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> From<Vec<<A as Array>::Item>> for SmallVec<A>
where\n A: Array,

§

fn from(vec: Vec<<A as Array>::Item>) -> SmallVec<A>

Converts to this type from the input type.
","From::Item>>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> FromIterator<<A as Array>::Item> for SmallVec<A>
where\n A: Array,

§

fn from_iter<I>(iterable: I) -> SmallVec<A>
where\n I: IntoIterator<Item = <A as Array>::Item>,

Creates a value from an iterator. Read more
","FromIterator<::Item>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Hash for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Hash,

§

fn hash<H>(&self, state: &mut H)
where\n 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\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A, I> Index<I> for SmallVec<A>
where\n A: Array,\n I: SliceIndex<[<A as Array>::Item]>,

§

type Output = <I as SliceIndex<[<A as Array>::Item]>>::Output

The returned type after indexing.
§

fn index(&self, index: I) -> &<I as SliceIndex<[<A as Array>::Item]>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A, I> IndexMut<I> for SmallVec<A>
where\n A: Array,\n I: SliceIndex<[<A as Array>::Item]>,

§

fn index_mut(\n &mut self,\n index: I,\n) -> &mut <I as SliceIndex<[<A as Array>::Item]>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> IntoIterator for SmallVec<A>
where\n A: Array,

§

type IntoIter = IntoIter<A>

Which kind of iterator are we turning this into?
§

type Item = <A as Array>::Item

The type of the elements being iterated over.
§

fn into_iter(self) -> <SmallVec<A> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
","IntoIterator","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Ord for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Ord,

§

fn cmp(&self, other: &SmallVec<A>) -> Ordering

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

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

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

fn min(self, other: Self) -> Self
where\n 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\n Self: Sized,

Restrict a value to a certain interval. Read more
","Ord","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A, B> PartialEq<SmallVec<B>> for SmallVec<A>
where\n A: Array,\n B: Array,\n <A as Array>::Item: PartialEq<<B as Array>::Item>,

§

fn eq(&self, other: &SmallVec<B>) -> 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,\nand should not be overridden without very good reason.
","PartialEq>","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> PartialOrd for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: PartialOrd,

§

fn partial_cmp(&self, other: &SmallVec<A>) -> 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\n<= 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 >\noperator. 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\nthe >= operator. Read more
","PartialOrd","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Serialize for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Serialize,

§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<T, const N: usize> SmallVec<[T; N]>

pub const fn new_const() -> SmallVec<[T; N]>

Construct an empty vector.

\n

This is a const version of [SmallVec::new] that is enabled by the feature const_new, with the limitation that it only works for arrays.

\n

pub const fn from_const(items: [T; N]) -> SmallVec<[T; N]>

The array passed as an argument is moved to be an inline version of SmallVec.

\n

This is a const version of [SmallVec::from_buf] that is enabled by the feature const_new, with the limitation that it only works for arrays.

\n

pub const unsafe fn from_const_with_len_unchecked(\n items: [T; N],\n len: usize,\n) -> SmallVec<[T; N]>

Constructs a new SmallVec on the stack from an array without\ncopying elements. Also sets the length. The user is responsible\nfor ensuring that len <= N.

\n

This is a const version of [SmallVec::from_buf_and_len_unchecked] that is enabled by the feature const_new, with the limitation that it only works for arrays.

\n
",0,"mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> SmallVec<A>
where\n A: Array,

pub fn new() -> SmallVec<A>

Construct an empty vector

\n

pub fn with_capacity(n: usize) -> SmallVec<A>

Construct an empty vector with enough capacity pre-allocated to store at least n\nelements.

\n

Will create a heap allocation only if n is larger than the inline capacity.

\n\n
\nlet v: SmallVec<[u8; 3]> = SmallVec::with_capacity(100);\n\nassert!(v.is_empty());\nassert!(v.capacity() >= 100);

pub fn from_vec(vec: Vec<<A as Array>::Item>) -> SmallVec<A>

Construct a new SmallVec from a Vec<A::Item>.

\n

Elements will be copied to the inline buffer if vec.capacity() <= Self::inline_capacity().

\n\n
use smallvec::SmallVec;\n\nlet vec = vec![1, 2, 3, 4, 5];\nlet small_vec: SmallVec<[_; 3]> = SmallVec::from_vec(vec);\n\nassert_eq!(&*small_vec, &[1, 2, 3, 4, 5]);

pub fn from_buf(buf: A) -> SmallVec<A>

Constructs a new SmallVec on the stack from an A without\ncopying elements.

\n\n
use smallvec::SmallVec;\n\nlet buf = [1, 2, 3, 4, 5];\nlet small_vec: SmallVec<_> = SmallVec::from_buf(buf);\n\nassert_eq!(&*small_vec, &[1, 2, 3, 4, 5]);

pub fn from_buf_and_len(buf: A, len: usize) -> SmallVec<A>

Constructs a new SmallVec on the stack from an A without\ncopying elements. Also sets the length, which must be less or\nequal to the size of buf.

\n\n
use smallvec::SmallVec;\n\nlet buf = [1, 2, 3, 4, 5, 0, 0, 0];\nlet small_vec: SmallVec<_> = SmallVec::from_buf_and_len(buf, 5);\n\nassert_eq!(&*small_vec, &[1, 2, 3, 4, 5]);

pub unsafe fn from_buf_and_len_unchecked(\n buf: MaybeUninit<A>,\n len: usize,\n) -> SmallVec<A>

Constructs a new SmallVec on the stack from an A without\ncopying elements. Also sets the length. The user is responsible\nfor ensuring that len <= A::size().

\n\n
use smallvec::SmallVec;\nuse std::mem::MaybeUninit;\n\nlet buf = [1, 2, 3, 4, 5, 0, 0, 0];\nlet small_vec: SmallVec<_> = unsafe {\n    SmallVec::from_buf_and_len_unchecked(MaybeUninit::new(buf), 5)\n};\n\nassert_eq!(&*small_vec, &[1, 2, 3, 4, 5]);

pub unsafe fn set_len(&mut self, new_len: usize)

Sets the length of a vector.

\n

This will explicitly set the size of the vector, without actually\nmodifying its buffers, so it is up to the caller to ensure that the\nvector is actually the specified size.

\n

pub fn inline_size(&self) -> usize

The maximum number of elements this vector can hold inline

\n

pub fn len(&self) -> usize

The number of elements stored in the vector

\n

pub fn is_empty(&self) -> bool

Returns true if the vector is empty

\n

pub fn capacity(&self) -> usize

The number of items the vector can hold without reallocating

\n

pub fn spilled(&self) -> bool

Returns true if the data has spilled into a separate heap-allocated buffer.

\n

pub fn drain<R>(&mut self, range: R) -> Drain<'_, A>
where\n R: RangeBounds<usize>,

Creates a draining iterator that removes the specified range in the vector\nand yields the removed items.

\n

Note 1: The element range is removed even if the iterator is only\npartially consumed or not consumed at all.

\n

Note 2: It is unspecified how many elements are removed from the vector\nif the Drain value is leaked.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n

pub fn push(&mut self, value: <A as Array>::Item)

Append an item to the vector.

\n

pub fn pop(&mut self) -> Option<<A as Array>::Item>

Remove an item from the end of the vector and return it, or None if empty.

\n

pub fn append<B>(&mut self, other: &mut SmallVec<B>)
where\n B: Array<Item = <A as Array>::Item>,

Moves all the elements of other into self, leaving other empty.

\n
§Example
\n
let mut v0: SmallVec<[u8; 16]> = smallvec![1, 2, 3];\nlet mut v1: SmallVec<[u8; 32]> = smallvec![4, 5, 6];\nv0.append(&mut v1);\nassert_eq!(*v0, [1, 2, 3, 4, 5, 6]);\nassert_eq!(*v1, []);

pub fn grow(&mut self, new_cap: usize)

Re-allocate to set the capacity to max(new_cap, inline_size()).

\n

Panics if new_cap is less than the vector’s length\nor if the capacity computation overflows usize.

\n

pub fn try_grow(&mut self, new_cap: usize) -> Result<(), CollectionAllocErr>

Re-allocate to set the capacity to max(new_cap, inline_size()).

\n

Panics if new_cap is less than the vector’s length

\n

pub fn reserve(&mut self, additional: usize)

Reserve capacity for additional more elements to be inserted.

\n

May reserve more space to avoid frequent reallocations.

\n

Panics if the capacity computation overflows usize.

\n

pub fn try_reserve(\n &mut self,\n additional: usize,\n) -> Result<(), CollectionAllocErr>

Reserve capacity for additional more elements to be inserted.

\n

May reserve more space to avoid frequent reallocations.

\n

pub fn reserve_exact(&mut self, additional: usize)

Reserve the minimum capacity for additional more elements to be inserted.

\n

Panics if the new capacity overflows usize.

\n

pub fn try_reserve_exact(\n &mut self,\n additional: usize,\n) -> Result<(), CollectionAllocErr>

Reserve the minimum capacity for additional more elements to be inserted.

\n

pub fn shrink_to_fit(&mut self)

Shrink the capacity of the vector as much as possible.

\n

When possible, this will move data from an external heap buffer to the vector’s inline\nstorage.

\n

pub fn truncate(&mut self, len: usize)

Shorten the vector, keeping the first len elements and dropping the rest.

\n

If len is greater than or equal to the vector’s current length, this has no\neffect.

\n

This does not re-allocate. If you want the vector’s capacity to shrink, call\nshrink_to_fit after truncating.

\n

pub fn as_slice(&self) -> &[<A as Array>::Item]

Extracts a slice containing the entire vector.

\n

Equivalent to &s[..].

\n

pub fn as_mut_slice(&mut self) -> &mut [<A as Array>::Item]

Extracts a mutable slice of the entire vector.

\n

Equivalent to &mut s[..].

\n

pub fn swap_remove(&mut self, index: usize) -> <A as Array>::Item

Remove the element at position index, replacing it with the last element.

\n

This does not preserve ordering, but is O(1).

\n

Panics if index is out of bounds.

\n

pub fn clear(&mut self)

Remove all elements from the vector.

\n

pub fn remove(&mut self, index: usize) -> <A as Array>::Item

Remove and return the element at position index, shifting all elements after it to the\nleft.

\n

Panics if index is out of bounds.

\n

pub fn insert(&mut self, index: usize, element: <A as Array>::Item)

Insert an element at position index, shifting all elements after it to the right.

\n

Panics if index > len.

\n

pub fn insert_many<I>(&mut self, index: usize, iterable: I)
where\n I: IntoIterator<Item = <A as Array>::Item>,

Insert multiple elements at position index, shifting all following elements toward the\nback.

\n

pub fn into_vec(self) -> Vec<<A as Array>::Item>

Convert a SmallVec to a Vec, without reallocating if the SmallVec has already spilled onto\nthe heap.

\n

pub fn into_boxed_slice(self) -> Box<[<A as Array>::Item]>

Converts a SmallVec into a Box<[T]> without reallocating if the SmallVec has already spilled\nonto the heap.

\n

Note that this will drop any excess capacity.

\n

pub fn into_inner(self) -> Result<A, SmallVec<A>>

Convert the SmallVec into an A if possible. Otherwise return Err(Self).

\n

This method returns Err(Self) if the SmallVec is too short (and the A contains uninitialized elements),\nor if the SmallVec is too long (and all the elements were spilled to the heap).

\n

pub fn retain<F>(&mut self, f: F)
where\n F: FnMut(&mut <A as Array>::Item) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all elements e such that f(&e) returns false.\nThis method operates in place and preserves the order of the retained\nelements.

\n

pub fn retain_mut<F>(&mut self, f: F)
where\n F: FnMut(&mut <A as Array>::Item) -> bool,

Retains only the elements specified by the predicate.

\n

This method is identical in behaviour to [retain]; it is included only\nto maintain api-compatibility with std::Vec, where the methods are\nseparate for historical reasons.

\n

pub fn dedup(&mut self)
where\n <A as Array>::Item: PartialEq,

Removes consecutive duplicate elements.

\n

pub fn dedup_by<F>(&mut self, same_bucket: F)
where\n F: FnMut(&mut <A as Array>::Item, &mut <A as Array>::Item) -> bool,

Removes consecutive duplicate elements using the given equality relation.

\n

pub fn dedup_by_key<F, K>(&mut self, key: F)
where\n F: FnMut(&mut <A as Array>::Item) -> K,\n K: PartialEq,

Removes consecutive elements that map to the same key.

\n

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where\n F: FnMut() -> <A as Array>::Item,

Resizes the SmallVec in-place so that len is equal to new_len.

\n

If new_len is greater than len, the SmallVec is extended by the difference, with each\nadditional slot filled with the result of calling the closure f. The return values from f\nwill end up in the SmallVec in the order they have been generated.

\n

If new_len is less than len, the SmallVec is simply truncated.

\n

This method uses a closure to create new values on every push. If you’d rather Clone a given\nvalue, use resize. If you want to use the Default trait to generate values, you can pass\nDefault::default() as the second argument.

\n

Added for std::vec::Vec compatibility (added in Rust 1.33.0)

\n\n
let mut vec : SmallVec<[_; 4]> = smallvec![1, 2, 3];\nvec.resize_with(5, Default::default);\nassert_eq!(&*vec, &[1, 2, 3, 0, 0]);\n\nlet mut vec : SmallVec<[_; 4]> = smallvec![];\nlet mut p = 1;\nvec.resize_with(4, || { p *= 2; p });\nassert_eq!(&*vec, &[2, 4, 8, 16]);

pub unsafe fn from_raw_parts(\n ptr: *mut <A as Array>::Item,\n length: usize,\n capacity: usize,\n) -> SmallVec<A>

Creates a SmallVec directly from the raw components of another\nSmallVec.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • ptr needs to have been previously allocated via SmallVec for its\nspilled storage (at least, it’s highly likely to be incorrect if it\nwasn’t).
  • \n
  • ptr’s A::Item type needs to be the same size and alignment that\nit was allocated with
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • capacity needs to be the capacity that the pointer was allocated\nwith.
  • \n
\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures.

\n

Additionally, capacity must be greater than the amount of inline\nstorage A has; that is, the new SmallVec must need to spill over\ninto heap allocated storage. This condition is asserted against.

\n

The ownership of ptr is effectively transferred to the\nSmallVec which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
use std::mem;\nuse std::ptr;\n\nfn main() {\n    let mut v: SmallVec<[_; 1]> = smallvec![1, 2, 3];\n\n    // Pull out the important parts of `v`.\n    let p = v.as_mut_ptr();\n    let len = v.len();\n    let cap = v.capacity();\n    let spilled = v.spilled();\n\n    unsafe {\n        // Forget all about `v`. The heap allocation that stored the\n        // three values won't be deallocated.\n        mem::forget(v);\n\n        // Overwrite memory with [4, 5, 6].\n        //\n        // This is only safe if `spilled` is true! Otherwise, we are\n        // writing into the old `SmallVec`'s inline storage on the\n        // stack.\n        assert!(spilled);\n        for i in 0..len {\n            ptr::write(p.add(i), 4 + i);\n        }\n\n        // Put everything back together into a SmallVec with a different\n        // amount of inline storage, but which is still less than `cap`.\n        let rebuilt = SmallVec::<[_; 2]>::from_raw_parts(p, len, cap);\n        assert_eq!(&*rebuilt, &[4, 5, 6]);\n    }\n}

pub fn as_ptr(&self) -> *const <A as Array>::Item

Returns a raw pointer to the vector’s buffer.

\n

pub fn as_mut_ptr(&mut self) -> *mut <A as Array>::Item

Returns a raw mutable pointer to the vector’s buffer.

\n
",0,"mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Clone,

pub fn resize(&mut self, len: usize, value: <A as Array>::Item)

Resizes the vector so that its length is equal to len.

\n

If len is less than the current length, the vector simply truncated.

\n

If len is greater than the current length, value is appended to the\nvector until its length equals len.

\n

pub fn from_elem(elem: <A as Array>::Item, n: usize) -> SmallVec<A>

Creates a SmallVec with n copies of elem.

\n\n
use smallvec::SmallVec;\n\nlet v = SmallVec::<[char; 128]>::from_elem('d', 2);\nassert_eq!(v, SmallVec::from_buf(['d', 'd']));
",0,"mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Copy,

pub fn from_slice(slice: &[<A as Array>::Item]) -> SmallVec<A>

Copy the elements from a slice into a new SmallVec.

\n

For slices of Copy types, this is more efficient than SmallVec::from(slice).

\n

pub fn insert_from_slice(&mut self, index: usize, slice: &[<A as Array>::Item])

Copy elements from a slice into the vector at position index, shifting any following\nelements toward the back.

\n

For slices of Copy types, this is more efficient than insert.

\n

pub fn extend_from_slice(&mut self, slice: &[<A as Array>::Item])

Copy elements from a slice and append them to the vector.

\n

For slices of Copy types, this is more efficient than extend.

\n
",0,"mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Write for SmallVec<A>
where\n A: Array<Item = u8>,

§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Writes a buffer into this writer, returning how many bytes were written. Read more
§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
§

fn flush(&mut self) -> Result<(), Error>

Flushes this output stream, ensuring that all intermediately buffered\ncontents reach their destination. Read more
1.36.0 · Source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored\nimplementation. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error\nencountered. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where\n Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
","Write","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Deref for SmallVec<A>
where\n A: Array,

§

type Target = [<A as Array>::Item]

The resulting type after dereferencing.
§

fn deref(&self) -> &[<A as Array>::Item]

Dereferences the value.
","Deref","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Eq for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Eq,

","Eq","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"],["
§

impl<A> Send for SmallVec<A>
where\n A: Array,\n <A as Array>::Item: Send,

","Send","mito2::access_layer::SstInfoArray","mito2::memtable::time_partition::PartitionVec","mito2::memtable::version::SmallMemtableVec","mito2::sst::file::IndexTypes"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() //{"start":55,"fragment_lengths":[108879]}