Struct contained_turing::Tape
source · pub struct Tape<S: Symbolic = String>(_);Implementations§
source§impl<S: Symbolic> Tape<S>
impl<S: Symbolic> Tape<S>
pub fn new() -> Self
sourcepub fn norm(iter: impl IntoIterator<Item = S>) -> Self
pub fn norm(iter: impl IntoIterator<Item = S>) -> Self
Creates a new tape from an iterator; preserves the original order.
sourcepub fn std(iter: impl IntoIterator<Item = S>) -> Self
pub fn std(iter: impl IntoIterator<Item = S>) -> Self
Creates a new tape from an iterator; the tape is reversed.
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new tape with the specified capacity.
pub fn write(&mut self, index: usize, symbol: S)
Trait Implementations§
source§impl<S: Symbolic> ArrayLike<S> for Tape<S>
impl<S: Symbolic> ArrayLike<S> for Tape<S>
source§fn append(&mut self, elem: &mut Self)
fn append(&mut self, elem: &mut Self)
ArrayLike::append describes a method for appending another array to the end of the array
fn as_slice(&self) -> &[T]
source§fn clear(&mut self)
fn clear(&mut self)
ArrayLike::clear describes a method for clearing the array
source§fn contains(&self, elem: &T) -> bool
fn contains(&self, elem: &T) -> bool
ArrayLike::contains describes a method for checking if an element is present in the array
source§fn count(&self, elem: &T) -> usize
fn count(&self, elem: &T) -> usize
ArrayLike::count describes a method for counting the number of times an element appears in the array
source§fn dedup(&mut self)
fn dedup(&mut self)
ArrayLike::dedup describes a method for removing duplicate elements from the array
source§fn dedup_by<F>(&mut self, same_bucket: F)where
F: FnMut(&mut T, &mut T) -> bool,
fn dedup_by<F>(&mut self, same_bucket: F)where F: FnMut(&mut T, &mut T) -> bool,
ArrayLike::dedup_by describes a method for removing duplicate elements from the array using a custom comparison function
source§fn dedup_by_key<F, K>(&mut self, key: F)where
F: FnMut(&mut T) -> K,
K: PartialEq<K>,
fn dedup_by_key<F, K>(&mut self, key: F)where F: FnMut(&mut T) -> K, K: PartialEq<K>,
ArrayLike::dedup_by_key describes a method for removing duplicate elements from the array using a custom key extraction function
source§fn drain(&mut self, range: Range<usize>) -> Drain<'_, T, Global>
fn drain(&mut self, range: Range<usize>) -> Drain<'_, T, Global>
ArrayLike::drain describes a method for removing a range of elements from the array
source§fn filter(&self, predicate: impl Fn(&T) -> bool) -> Vec<T, Global>
fn filter(&self, predicate: impl Fn(&T) -> bool) -> Vec<T, Global>
ArrayLike::filter describes a method for filtering the array
source§fn first(&self) -> Option<&T>
fn first(&self) -> Option<&T>
ArrayLike::first describes a method for getting a reference to the first element in the array
source§fn get(&self, index: usize) -> Option<&T>
fn get(&self, index: usize) -> Option<&T>
ArrayLike::get describes a method for getting a reference to an element at a specific position
source§fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
ArrayLike::get_mut describes a method for getting a mutable reference to an element at a specific position
source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
ArrayLike::is_empty checks if the array is empty
source§fn last(&self) -> Option<&T>
fn last(&self) -> Option<&T>
ArrayLike::last describes a method for gettings the last element in the array
source§fn len(&self) -> usize
fn len(&self) -> usize
ArrayLike::len describes a method for getting the length of the array
source§fn pop(&mut self) -> Option<T>
fn pop(&mut self) -> Option<T>
ArrayLike::pop describes a method for removing the last element from the array
source§fn push(&mut self, elem: T)
fn push(&mut self, elem: T)
ArrayLike::push describes a method for adding an element to the end of the array
source§fn remove(&mut self, index: usize) -> T
fn remove(&mut self, index: usize) -> T
ArrayLike::remove describes a method for removing an element at a specific position
fn reverse(&mut self)
source§fn set(&mut self, index: usize, elem: T)
fn set(&mut self, index: usize, elem: T)
ArrayLike::set describes a method for setting the value of an element at a specific position
source§fn shrink_to(&mut self, min_capacity: usize)
fn shrink_to(&mut self, min_capacity: usize)
ArrayLike::shrink_to describes a method for shrinking the capacity of the array to a specific minimum
source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
ArrayLike::shrink_to_fit describes a method for shrinking the capacity of the array to match its length
source§fn splice(
&mut self,
range: Range<usize>,
replace_with: Vec<T, Global>
) -> Vec<T, Global>
fn splice( &mut self, range: Range<usize>, replace_with: Vec<T, Global> ) -> Vec<T, Global>
ArrayLike::splice describes a method for removing a range of elements and replacing them with another array
source§fn split_off(&mut self, at: usize) -> Vec<T, Global>
fn split_off(&mut self, at: usize) -> Vec<T, Global>
ArrayLike::split_off describes a method for splitting the array into two at a specific position
source§fn swap_remove(&mut self, index: usize) -> T
fn swap_remove(&mut self, index: usize) -> T
ArrayLike::swap_remove describes a method for removing an element at a specific position and returning it, replacing it with the last element
source§fn truncate(&mut self, len: usize)
fn truncate(&mut self, len: usize)
ArrayLike::truncate describes a method for truncating the array to a specific length
source§impl<'de, S> Deserialize<'de> for Tape<S>where
S: Deserialize<'de> + Symbolic,
impl<'de, S> Deserialize<'de> for Tape<S>where S: Deserialize<'de> + Symbolic,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S: Symbolic> Extend<S> for Tape<S>
impl<S: Symbolic> Extend<S> for Tape<S>
source§fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
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)
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
source§impl<S: Symbolic> FromIterator<S> for Tape<S>
impl<S: Symbolic> FromIterator<S> for Tape<S>
source§fn from_iter<T: IntoIterator<Item = S>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = S>>(iter: T) -> Self
Creates a value from an iterator. Read more
source§impl<S: Symbolic> IntoIterator for Tape<S>
impl<S: Symbolic> IntoIterator for Tape<S>
source§impl<S: Ord + Symbolic> Ord for Tape<S>
impl<S: Ord + Symbolic> Ord for Tape<S>
source§impl<S: PartialEq + Symbolic> PartialEq<Tape<S>> for Tape<S>
impl<S: PartialEq + Symbolic> PartialEq<Tape<S>> for Tape<S>
source§impl<S: PartialOrd + Symbolic> PartialOrd<Tape<S>> for Tape<S>
impl<S: PartialOrd + Symbolic> PartialOrd<Tape<S>> for Tape<S>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more