pub fn from_slice(x: &[T], journal: &Journal<A>) -> Self {
        if x.len() == 0 {
            Self::empty()
        } else {
            let buf = unsafe { A::new_slice(x, journal) };
            let offset = unsafe { A::off_unchecked(buf) };
            Self::from_off_len(offset, buf.len(), buf.len())
        }
    }
/// Creates an empty vector and places `x` into it
///
/// # Examples
///
/// ```
/// # use corundum::vec::Vec;
/// # use corundum::alloc::heap::*;
/// Heap::transaction(|j| {
///     let mut vec = Vec::from_slice(&[1, 2], j);
///
///     assert_eq!(vec.len(), 2);
///     assert_eq!(vec[0], 1);
///
///     assert_eq!(vec.pop(), Some(2));
///     assert_eq!(vec.len(), 1);
///
///     vec.extend_from_slice(&[1, 2, 3], j);
///
///     for x in &*vec {
///         println!("{}", x);
///     }
///
///     assert_eq!(vec, [1, 1, 2, 3]);
/// }).unwrap();
/// ```
Creates an empty vector and places `x` into it
Creates an empty vector and places ` x ` into it
pub fn from_slice(x: &[T], journal: &Journal<A>) -> Self {
        if x.len() == 0 {
            Self::empty()
        } else {
            let buf = unsafe { A::new_slice(x, journal) };
            let offset = unsafe { A::off_unchecked(buf) };
            Self::from_off_len(offset, buf.len(), buf.len())
        }
    }
pub fn from_slice ( x : & [ T ] , journal : & Journal < A > ) -> Self { if x . len ( ) == 0 { Self :: empty ( ) } else { let buf = unsafe { A :: new_slice ( x , journal ) } ; let offset = unsafe { A :: off_unchecked ( buf ) } ; Self :: from_off_len ( offset , buf . len ( ) , buf . len ( ) ) } }
Creates an empty vector and places `x` into it
Creates an empty vector and places ` x ` into it
x
&[T]
journal
&Journal<A>
examples
None
use corundum::vec::vec;
None
use corundum::alloc::heap::*;
None