pub struct UseStreams {
pub ids: Signal<Vec<u32>>,
pub add: Callback<(), u32>,
pub remove: Callback<u32>,
}Expand description
Handle returned by use_streams.
Fields§
§ids: Signal<Vec<u32>>The current list of active stream ids, in insertion order.
Because ids is a field (not a method), call let ids = streams.ids;
before reading so rsx! can use ids() as a Signal call, Rust’s
method-call syntax would otherwise treat streams.ids() as a method.
add: Callback<(), u32>Callback that appends a fresh id and returns it.
Ids are allocated monotonically from 0 and never reused within one hook instance, so the returned id is safe to use as a Dioxus key.
remove: Callback<u32>Callback that removes the given id from the list. No-op if absent.
The stream’s Registry entry and camera pump are
torn down automatically via the
use_camera_stream drop guard when the
corresponding component unmounts, you do not need to touch the
registry here.
Trait Implementations§
Source§impl Clone for UseStreams
impl Clone for UseStreams
Source§fn clone(&self) -> UseStreams
fn clone(&self) -> UseStreams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for UseStreams
impl PartialEq for UseStreams
impl Copy for UseStreams
impl StructuralPartialEq for UseStreams
Auto Trait Implementations§
impl Freeze for UseStreams
impl !RefUnwindSafe for UseStreams
impl !Send for UseStreams
impl !Sync for UseStreams
impl Unpin for UseStreams
impl UnsafeUnpin for UseStreams
impl !UnwindSafe for UseStreams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.