pub struct CustomNodeContext<'a> {
pub tag: &'a str,
pub media_source: Option<&'a str>,
pub container_style: &'a ContainerStyle,
pub text_style: &'a TextStyle,
pub measurer: Arc<dyn TextMeasurer>,
pub images: &'a HashMap<String, Image>,
pub audio: &'a HashMap<String, Arc<[u8]>>,
pub get_attr: &'a dyn Fn(&str) -> Option<String>,
pub write_back: Option<(DomWriteBack, u32)>,
pub dom_snapshot: &'a DomSnapshot,
pub dom_id: NodeId,
}Expand description
Context handed to a CustomNodeFactory to construct a component.
Fields§
§tag: &'a strThe HTML tag name (e.g. "button").
media_source: Option<&'a str>Inner text of the element, if any.
container_style: &'a ContainerStyleResolved container style (background, border, …).
text_style: &'a TextStyleInherited text style.
measurer: Arc<dyn TextMeasurer>Text measurer for text-heavy components.
images: &'a HashMap<String, Image>Decoded images keyed by src URL.
audio: &'a HashMap<String, Arc<[u8]>>Encoded audio bytes keyed by src URL.
get_attr: &'a dyn Fn(&str) -> Option<String>Attribute accessor.
write_back: Option<(DomWriteBack, u32)>Channel + snapshot node id for value write-back (bidirectional sync).
dom_snapshot: &'a DomSnapshotDom snapshot.
dom_id: NodeIdThe node id.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CustomNodeContext<'a>
impl<'a> !Send for CustomNodeContext<'a>
impl<'a> !Sync for CustomNodeContext<'a>
impl<'a> !UnwindSafe for CustomNodeContext<'a>
impl<'a> Freeze for CustomNodeContext<'a>
impl<'a> Unpin for CustomNodeContext<'a>
impl<'a> UnsafeUnpin for CustomNodeContext<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more