Struct fral::Fral [] [src]

pub struct Fral<T> { /* fields omitted */ }

An Arc-based functional random access list.

Methods

impl<T> Fral<T>
[src]

[src]

Construct an empty list.

[src]

Returns a reference to an element, or None if it is out of bounds.

Time: O(log n)

Examples

let f: Fral<_> = vec![7, 0, 17].into_iter().rev().collect();
assert_eq!(f.get(2), Some(Arc::new(17)));

[src]

Insert an element at the front of the list.

Time: O(1)

[src]

Get the head and tail of the list.

Time: O(1)

[src]

Returns true iff the list contains no elements.

Time: O(1)

[src]

Get the number of items in the list.

Time: O(1)

Important traits for Iter<T>
[src]

Trait Implementations

impl<T: Hash> Hash for Fral<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Debug> Debug for Fral<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq> PartialEq for Fral<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq> Eq for Fral<T>
[src]

impl<T> Clone for Fral<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Default for Fral<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T> IntoIterator for Fral<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for Iter<T>
[src]

Creates an iterator from a value. Read more

impl<T, R: AsArc<T>> FromIterator<R> for Fral<T>
[src]

This is done with repeated cons, so you may intend to reverse your iterator first.

Examples

let items = vec![1, 2, 3];
let f: Fral<_> = items.into_iter().collect();

// the first item in f is the last item of the iterator
assert_eq!(f.get(0), Some(Arc::new(3)));

[src]

Creates a value from an iterator. Read more

Auto Trait Implementations

impl<T> Send for Fral<T> where
    T: Send + Sync

impl<T> Sync for Fral<T> where
    T: Send + Sync