Struct contained_turing::Tape

source ·
pub struct Tape<S: Symbolic = String>(_);

Implementations§

source§

impl<S: Symbolic> Tape<S>

source

pub fn new() -> Self

source

pub fn norm(iter: impl IntoIterator<Item = S>) -> Self

Creates a new tape from an iterator; preserves the original order.

source

pub fn std(iter: impl IntoIterator<Item = S>) -> Self

Creates a new tape from an iterator; the tape is reversed.

source

pub fn with_capacity(capacity: usize) -> Self

Creates a new tape with the specified capacity.

source

pub fn write(&mut self, index: usize, symbol: S)

Trait Implementations§

source§

impl<S: Symbolic> ArrayLike<S> for Tape<S>

source§

fn append(&mut self, elem: &mut Self)

ArrayLike::append describes a method for appending another array to the end of the array
source§

fn as_slice(&self) -> &[T]

source§

fn capacity(&self) -> usize

The capacity of the array
source§

fn clear(&mut self)

ArrayLike::clear describes a method for clearing the array
source§

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

ArrayLike::count describes a method for counting the number of times an element appears in the array
source§

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,

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>,

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>

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>

ArrayLike::filter describes a method for filtering the array
source§

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>

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>

ArrayLike::get_mut describes a method for getting a mutable reference to an element at a specific position
source§

fn is_empty(&self) -> bool

ArrayLike::is_empty checks if the array is empty
source§

fn last(&self) -> Option<&T>

ArrayLike::last describes a method for gettings the last element in the array
source§

fn len(&self) -> usize

ArrayLike::len describes a method for getting the length of the array
source§

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)

ArrayLike::push describes a method for adding an element to the end of the array
source§

fn remove(&mut self, index: usize) -> T

ArrayLike::remove describes a method for removing an element at a specific position
source§

fn reverse(&mut self)

source§

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)

ArrayLike::shrink_to describes a method for shrinking the capacity of the array to a specific minimum
source§

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>

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>

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

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)

ArrayLike::truncate describes a method for truncating the array to a specific length
source§

impl<S: Symbolic> AsMut<Vec<S, Global>> for Tape<S>

source§

fn as_mut(&mut self) -> &mut Vec<S>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S: Symbolic> AsRef<Vec<S, Global>> for Tape<S>

source§

fn as_ref(&self) -> &Vec<S>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Clone + Symbolic> Clone for Tape<S>

source§

fn clone(&self) -> Tape<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug + Symbolic> Debug for Tape<S>

source§

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

Formats the value using the given formatter. Read more
source§

impl<S: Default + Symbolic> Default for Tape<S>

source§

fn default() -> Tape<S>

Returns the “default value” for a type. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S: Symbolic> Extend<S> for Tape<S>

source§

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)

🔬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
source§

impl<S: Symbolic> From<Tape<S>> for Driver<S>

source§

fn from(tape: Tape<S>) -> Self

Converts to this type from the input type.
source§

impl<S: Symbolic> From<Tape<S>> for Vec<S>

source§

fn from(tape: Tape<S>) -> Vec<S>

Converts to this type from the input type.
source§

impl<S: Symbolic> FromIterator<S> for Tape<S>

source§

fn from_iter<T: IntoIterator<Item = S>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<S: Hash + Symbolic> Hash for Tape<S>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<S: Symbolic> Index<usize> for Tape<S>

§

type Output = S

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<S: Symbolic> IndexMut<usize> for Tape<S>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<S: Symbolic> Insert<usize, S> for Tape<S>

source§

fn insert(&mut self, index: usize, elem: S)

source§

impl<S: Symbolic> IntoIterator for Tape<S>

§

type Item = S

The type of the elements being iterated over.
§

type IntoIter = IntoIter<S, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<S: Ord + Symbolic> Ord for Tape<S>

source§

fn cmp(&self, other: &Tape<S>) -> Ordering

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

fn max(self, other: Self) -> Selfwhere Self: Sized,

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

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<S: PartialEq + Symbolic> PartialEq<Tape<S>> for Tape<S>

source§

fn eq(&self, other: &Tape<S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: PartialOrd + Symbolic> PartialOrd<Tape<S>> for Tape<S>

source§

fn partial_cmp(&self, other: &Tape<S>) -> 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

This method 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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S> Serialize for Tape<S>where S: Serialize + Symbolic,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<S: Eq + Symbolic> Eq for Tape<S>

source§

impl<S: Symbolic> Iterable<usize, S> for Tape<S>

source§

impl<S: Symbolic> StructuralEq for Tape<S>

source§

impl<S: Symbolic> StructuralPartialEq for Tape<S>

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Tape<S>where S: RefUnwindSafe,

§

impl<S> Send for Tape<S>where S: Send,

§

impl<S> Sync for Tape<S>where S: Sync,

§

impl<S> Unpin for Tape<S>where S: Unpin,

§

impl<S> UnwindSafe for Tape<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

§

impl<T> Sequence for Twhere T: Eq + Hash,

source§

impl<T> StateSpec for T