pub struct ShadowTreeRegistry {
roots_by_host: BTreeMap<usize, ShadowRootData>,
hosts_by_root: BTreeMap<usize, usize>,
}Expand description
シャドウツリーの管理レジストリ(DomBridge 等に組み込み可能)。
Fields§
§roots_by_host: BTreeMap<usize, ShadowRootData>host_idx -> ShadowRootData
hosts_by_root: BTreeMap<usize, usize>root_node_idx -> host_idx
Implementations§
Source§impl ShadowTreeRegistry
impl ShadowTreeRegistry
pub fn new() -> Self
Sourcepub fn attach_shadow(
&mut self,
host_idx: usize,
tag_name: &str,
mode: ShadowRootMode,
new_root_idx: usize,
) -> Result<ShadowRootData, AttachShadowError>
pub fn attach_shadow( &mut self, host_idx: usize, tag_name: &str, mode: ShadowRootMode, new_root_idx: usize, ) -> Result<ShadowRootData, AttachShadowError>
ホスト要素に ShadowRoot をアタッチする。
Sourcepub fn get_by_host(&self, host_idx: usize) -> Option<&ShadowRootData>
pub fn get_by_host(&self, host_idx: usize) -> Option<&ShadowRootData>
ホスト要素の ShadowRoot を取得。
Sourcepub fn get_host_by_root(&self, root_idx: usize) -> Option<usize>
pub fn get_host_by_root(&self, root_idx: usize) -> Option<usize>
ルートノード index からホスト要素 index を取得。
Sourcepub fn is_shadow_root(&self, node_idx: usize) -> bool
pub fn is_shadow_root(&self, node_idx: usize) -> bool
指定ノードが ShadowRoot 仮想ノードかどうか。
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ShadowTreeRegistry
impl Clone for ShadowTreeRegistry
Source§fn clone(&self) -> ShadowTreeRegistry
fn clone(&self) -> ShadowTreeRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShadowTreeRegistry
impl Debug for ShadowTreeRegistry
Source§impl Default for ShadowTreeRegistry
impl Default for ShadowTreeRegistry
Source§fn default() -> ShadowTreeRegistry
fn default() -> ShadowTreeRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShadowTreeRegistry
impl RefUnwindSafe for ShadowTreeRegistry
impl Send for ShadowTreeRegistry
impl Sync for ShadowTreeRegistry
impl Unpin for ShadowTreeRegistry
impl UnsafeUnpin for ShadowTreeRegistry
impl UnwindSafe for ShadowTreeRegistry
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