pub struct ComposeRenderer { /* private fields */ }Expand description
dioxus-core mutation sink that writes the Compose wire protocol directly.
Implementations§
Source§impl ComposeRenderer
impl ComposeRenderer
pub fn new() -> Self
Sourcepub fn arena(&self) -> (*const u8, usize)
pub fn arena(&self) -> (*const u8, usize)
The batch arena, so a runtime that reads Host memory through a mapped view can be handed one.
pub fn begin_frame(&mut self)
pub fn finish_frame(&mut self) -> Result<&[u8], ProtocolError>
pub fn handler(&self, handler_id: u64) -> Option<(ElementId, u32, &'static str)>
pub fn set_text( &mut self, element: ElementId, text: &str, selection: Option<Selection>, )
Sourcepub fn set_theme(&mut self, theme: Theme)
pub fn set_theme(&mut self, theme: Theme)
The root theme record. Written once per rebuild, never per frame.
Sourcepub fn set_window(&mut self, window: Window)
pub fn set_window(&mut self, window: Window)
The root window record. Written once per rebuild, never per frame.
pub fn set_text_node( &mut self, node_id: u32, text: &str, selection: Option<Selection>, )
Sourcepub fn register_asset(&mut self, asset_id: u32, kind: AssetKind, bytes: &[u8])
pub fn register_asset(&mut self, asset_id: u32, kind: AssetKind, bytes: &[u8])
Copies one asset into the batch. The bytes ride behind the records, and the Renderer takes its own copy inside the call that carries them.
pub fn release_asset(&mut self, asset_id: u32)
Sourcepub fn show_message(
&mut self,
handler_id: u64,
text: &str,
action: &str,
duration: MessageDuration,
)
pub fn show_message( &mut self, handler_id: u64, text: &str, action: &str, duration: MessageDuration, )
Writes one transient message into the batch.
It names no node, because a message is not in the tree: it is a sentence with a lifetime, and that lifetime belongs to the Renderer.
Sourcepub fn append_text_node(&mut self, node_id: u32, text: &str)
pub fn append_text_node(&mut self, node_id: u32, text: &str)
Append the streamed tail to a Text node without resending its whole value.
Trait Implementations§
Source§impl Default for ComposeRenderer
impl Default for ComposeRenderer
Source§impl WriteMutations for ComposeRenderer
impl WriteMutations for ComposeRenderer
Source§fn append_children(&mut self, id: ElementId, m: usize)
fn append_children(&mut self, id: ElementId, m: usize)
Add these m children to the target element Read more
Source§fn assign_node_id(&mut self, path: &'static [u8], id: ElementId)
fn assign_node_id(&mut self, path: &'static [u8], id: ElementId)
Assign the element at the given path the target ElementId. Read more
Source§fn create_placeholder(&mut self, id: ElementId)
fn create_placeholder(&mut self, id: ElementId)
Create a placeholder in the DOM that we will use later. Read more
Source§fn create_text_node(&mut self, value: &str, id: ElementId)
fn create_text_node(&mut self, value: &str, id: ElementId)
Create a node specifically for text with the given value Read more
Source§fn load_template(&mut self, template: Template, index: usize, id: ElementId)
fn load_template(&mut self, template: Template, index: usize, id: ElementId)
Load and clone an existing node from a template saved under that specific name Read more
Source§fn replace_node_with(&mut self, id: ElementId, m: usize)
fn replace_node_with(&mut self, id: ElementId, m: usize)
Replace the target element (given by its ID) with the topmost m nodes on the stack Read more
Source§fn replace_placeholder_with_nodes(&mut self, path: &'static [u8], m: usize)
fn replace_placeholder_with_nodes(&mut self, path: &'static [u8], m: usize)
Replace an existing element in the template at the given path with the m nodes on the stack Read more
Source§fn insert_nodes_after(&mut self, id: ElementId, m: usize)
fn insert_nodes_after(&mut self, id: ElementId, m: usize)
Insert a number of nodes after a given node. Read more
Source§fn insert_nodes_before(&mut self, id: ElementId, m: usize)
fn insert_nodes_before(&mut self, id: ElementId, m: usize)
Insert a number of nodes before a given node. Read more
Source§fn set_attribute(
&mut self,
name: &'static str,
_namespace: Option<&'static str>,
value: &AttributeValue,
id: ElementId,
)
fn set_attribute( &mut self, name: &'static str, _namespace: Option<&'static str>, value: &AttributeValue, id: ElementId, )
Set the value of a node’s attribute. Read more
Source§fn set_node_text(&mut self, value: &str, id: ElementId)
fn set_node_text(&mut self, value: &str, id: ElementId)
Set the text content of a node. Read more
Source§fn create_event_listener(&mut self, name: &'static str, id: ElementId)
fn create_event_listener(&mut self, name: &'static str, id: ElementId)
Create a new Event Listener. Read more
Source§fn remove_event_listener(&mut self, name: &'static str, id: ElementId)
fn remove_event_listener(&mut self, name: &'static str, id: ElementId)
Remove an existing Event Listener. Read more
Source§fn remove_node(&mut self, id: ElementId)
fn remove_node(&mut self, id: ElementId)
Remove a particular node from the DOM Read more
Auto Trait Implementations§
impl Freeze for ComposeRenderer
impl RefUnwindSafe for ComposeRenderer
impl Send for ComposeRenderer
impl Sync for ComposeRenderer
impl Unpin for ComposeRenderer
impl UnsafeUnpin for ComposeRenderer
impl UnwindSafe for ComposeRenderer
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> 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.