[][src]Struct stork::Storkable

pub struct Storkable<T: Unpin, C: StorkClient<T>> { /* fields omitted */ }

A Storkable represents a "thing" which is traversable ("storkable").

To start "storking" an initial Storkable can be constructed with with Storkable::new, once initialised filters can be added using Storkable::with_filters.

After a Storkable has been initialised, the storking can begin with a call to Storkable::exec which will return a stream of more Storkables (with the filters from the parent Storkable copied) which in turn can also be storked if necessary.

A Storkable derives its functionality from its two generics, T and C: StorkClient<T>. The StorkClient implementation will be called with a value of T, and is expected to return all the values of T that can be found on the given T.

Methods

impl<'a, T: Unpin + 'a, C: StorkClient<T> + 'a> Storkable<T, C>[src]

pub fn new(val: T) -> Self[src]

Instantiates a new Storkable from a T, storking can then begin on the given entrypoint using the Storkable::exec method.

pub fn with_filters(self, filters: FilterSet<T>) -> Self[src]

Attaches a FilterSet to this Storkable and any children found after executing this one.

pub fn with_client(self, client: C) -> Self[src]

Replaces the default StorkClient with a new one accepting and returning the same type for this Storkable.

pub fn filters(&self) -> &FilterSet<T>[src]

pub fn val(&self) -> &T[src]

Get the value of this Storkable.

pub fn parent(&self) -> Option<&Storkable<T, C>>[src]

Get the Storkable from which this Storkable was found on.

pub fn exec<'b>(self) -> impl Stream<Item = Result<Storkable<T, C>, Error>> + 'a[src]

Start storking this Storkable.

Finds all the followable links on this Storkable and returns a stream of more Storkables with the same filters and the parent set to a reference of the current Storkable.

Trait Implementations

impl<T: Clone + Unpin, C: Clone + StorkClient<T>> Clone for Storkable<T, C>[src]

impl<T: Debug + Unpin, C: Debug + StorkClient<T>> Debug for Storkable<T, C>[src]

Auto Trait Implementations

impl<T, C> !RefUnwindSafe for Storkable<T, C>

impl<T, C> !Send for Storkable<T, C>

impl<T, C> !Sync for Storkable<T, C>

impl<T, C> Unpin for Storkable<T, C>

impl<T, C> !UnwindSafe for Storkable<T, C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.