[−][src]Struct dasp::signal::Fork
Represents a forked Signal
that has not yet been split into its two branches.
A Fork
can be split into its two branches via either of the following methods:
fork.by_rc()
: consumes self and shares the fork viaRc<RefCell>
.fork.by_ref()
: borrows self and shares the fork via&RefCell
.
Implementations
impl<S, D> Fork<S, D>
[src]
pub fn by_rc(self) -> (BranchRcA<S, D>, BranchRcB<S, D>)
[src]
Consumes the Fork
and returns two branches that share the signal and inner ring buffer
via a reference countered pointer (Rc
).
Note: This requires dynamical allocation as Rc<RefCell<Self>>
is used to share the signal
and ring buffer. A user may avoid this dynamic allocation by using the Fork::by_ref
method instead, however this comes with the ergonomic cost of bounding the lifetime of the
branches to the lifetime of the fork.
Fork::by_ref
pub fn by_ref(&mut self) -> (BranchRefA<S, D>, BranchRefB<S, D>)
[src]
Mutably borrows the Fork
and returns two branches that share the signal and inner ring
buffer via reference.
This is more efficient than Fork::by_rc
as it does not require Rc
, however it may be
less ergonomic in some cases as the returned branches are bound to the lifetime of Fork
.
Trait Implementations
Auto Trait Implementations
impl<S, D> !RefUnwindSafe for Fork<S, D>
impl<S, D> Send for Fork<S, D> where
D: Send,
S: Send,
D: Send,
S: Send,
impl<S, D> !Sync for Fork<S, D>
impl<S, D> Unpin for Fork<S, D> where
D: Unpin,
S: Unpin,
D: Unpin,
S: Unpin,
impl<S, D> UnwindSafe for Fork<S, D> where
D: UnwindSafe,
S: UnwindSafe,
D: UnwindSafe,
S: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
[src]
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
[src]
fn from_sample_(s: S) -> S
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
[src]
U: FromSample<T>,
fn to_sample_(self) -> U
[src]
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.
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>,