[−][src]Enum mini_kanren::core::stream::Stream
Possibly infinite sequence of values.
Variants
Implementations
impl<T> Stream<T>
[src]
pub fn empty() -> Self
[src]
Initialize an empty stream.
pub fn singleton(x: T) -> Self
[src]
Create a stream with one element.
pub fn cons(a: T, d: Self) -> Self
[src]
Prepend an element to a stream.
pub fn suspension(sup: impl 'static + FnOnce() -> Stream<T>) -> Self
[src]
Create a suspended (lazily evaluated) stream.
pub fn from_iter(mut iter: impl Iterator<Item = T>) -> Self
[src]
Create a stream with elements from an iterator.
pub fn is_empty(&self) -> bool
[src]
Return true
if the stream is empty.
pub fn len(&self) -> Option<usize>
[src]
Return the number of elements in an unsuspended stream, or None
if
the stream contains any suspensions.
pub fn take_inf(self, n: usize) -> Stream<T>
[src]
Truncate a stream to at most n
elements, resolving any suspensions.
pub fn take_inf_all(self) -> Stream<T>
[src]
Resolve all suspensions in the stream. If the stream is infinite this function will not return and may crash.
pub fn into_vec(self) -> Vec<T>
[src]
Convert Stream
to Vec
.
impl<T: 'static + Default> Stream<T>
[src]
pub fn append_inf(s: Stream<T>, t: Stream<T>) -> Self
[src]
pub fn append_map_inf(self, g: impl 'static + Clone + Goal<T>) -> Self
[src]
pub fn map<U: 'static>(self, f: impl 'static + Fn(T) -> U) -> Stream<U>
[src]
Trait Implementations
impl<T: Debug> Debug for Stream<T>
[src]
impl<T> IntoIterator for Stream<T>
[src]
type Item = T
The type of the elements being iterated over.
type IntoIter = StreamIter<T>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<T: PartialEq> PartialEq<Stream<T>> for Stream<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Stream<T>
[src]
impl<T> !Send for Stream<T>
[src]
impl<T> !Sync for Stream<T>
[src]
impl<T> Unpin for Stream<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> !UnwindSafe for Stream<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,