pub struct Mutable<E> { /* private fields */ }Expand description
Transient vector. Unlike Java’s 32-slot scratch tail with null padding,
the Rust tail is a Vec<E> whose length is always exactly
size - tailoff(size); the “scratch” behaviour comes from in-place
push/pop on that Vec. All tree nodes touched by the transient are
stamped with its token and mutated in place only while uniquely owned
(Rc::strong_count == 1), matching Java’s edit-token discipline.
Implementations§
Source§impl<E: Clone> Mutable<E>
impl<E: Clone> Mutable<E>
pub fn new() -> Self
pub fn from_iter(values: impl IntoIterator<Item = E>) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<&E>
pub fn iter(&self) -> impl Iterator<Item = &E>
pub fn push_last(&mut self, value: E) -> &mut Self
pub fn assoc(&mut self, index: usize, value: E) -> &mut Self
pub fn pop_last(&mut self) -> Option<E>
pub fn empty(&mut self) -> &mut Self
Trait Implementations§
Source§impl<E: Clone> FromIterator<E> for Mutable<E>
impl<E: Clone> FromIterator<E> for Mutable<E>
Source§fn from_iter<T: IntoIterator<Item = E>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = E>>(iter: T) -> Self
Creates a value from an iterator. Read more
impl<E: Clone> IMutable for Mutable<E>
Source§impl<E: Clone> IToPersistent for Mutable<E>
impl<E: Clone> IToPersistent for Mutable<E>
type Persistent = Standard<E>
fn to_persistent(&mut self) -> Self::Persistent
Auto Trait Implementations§
impl<E> !RefUnwindSafe for Mutable<E>
impl<E> !Send for Mutable<E>
impl<E> !Sync for Mutable<E>
impl<E> !UnwindSafe for Mutable<E>
impl<E> Freeze for Mutable<E>
impl<E> Unpin for Mutable<E>
impl<E> UnsafeUnpin for Mutable<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more