#[repr(C)]pub struct IntersectionObserverEntry {
reflector_: Reflector,
target: Dom<Element>,
}
Expand description
An individual IntersectionObserver entry.
https://w3c.github.io/IntersectionObserver/#intersection-observer-entry
Fields§
§reflector_: Reflector
§target: Dom<Element>
Implementations§
source§impl IntersectionObserverEntry
impl IntersectionObserverEntry
fn __assert_parent_type(&self)
source§impl IntersectionObserverEntry
impl IntersectionObserverEntry
pub fn new_inherited(init: &IntersectionObserverEntryInit) -> Self
fn new( window: &Window, proto: Option<HandleObject<'_>>, init: &IntersectionObserverEntryInit, can_gc: CanGc, ) -> Root<Dom<Self>>
Trait Implementations§
source§impl DomObjectWrap for IntersectionObserverEntry
impl DomObjectWrap for IntersectionObserverEntry
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::IntersectionObserverEntryBinding::IntersectionObserverEntry_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::intersectionobserverentry::IntersectionObserverEntry>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::intersectionobserverentry::IntersectionObserverEntry>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::IntersectionObserverEntryBinding::IntersectionObserverEntry_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::intersectionobserverentry::IntersectionObserverEntry>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::intersectionobserverentry::IntersectionObserverEntry>>}
source§impl IntersectionObserverEntryMethods<DomTypeHolder> for IntersectionObserverEntry
impl IntersectionObserverEntryMethods<DomTypeHolder> for IntersectionObserverEntry
source§fn Time(&self) -> Finite<f64>
fn Time(&self) -> Finite<f64>
The attribute must return a DOMHighResTimeStamp that corresponds to the time the intersection was recorded, relative to the time origin of the global object associated with the IntersectionObserver instance that generated the notification.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-time
source§fn GetRootBounds(&self) -> Option<Root<Dom<DOMRectReadOnly>>>
fn GetRootBounds(&self) -> Option<Root<Dom<DOMRectReadOnly>>>
For a same-origin-domain target, this will be the root intersection rectangle. Otherwise, this will be null. Note that if the target is in a different browsing context than the intersection root, this will be in a different coordinate system than boundingClientRect and intersectionRect.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-rootbounds
source§fn BoundingClientRect(&self) -> Root<Dom<DOMRectReadOnly>>
fn BoundingClientRect(&self) -> Root<Dom<DOMRectReadOnly>>
A DOMRectReadOnly obtained by getting the bounding box for target.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-boundingclientrect
source§fn IntersectionRect(&self) -> Root<Dom<DOMRectReadOnly>>
fn IntersectionRect(&self) -> Root<Dom<DOMRectReadOnly>>
boundingClientRect, intersected by each of target’s ancestors’ clip rects (up to but not including root), intersected with the root intersection rectangle. This value represents the portion of target that intersects with the root intersection rectangle.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-intersectionrect
source§fn IsIntersecting(&self) -> bool
fn IsIntersecting(&self) -> bool
True if the target intersects with the root; false otherwise. This flag makes it possible to distinguish between an IntersectionObserverEntry signalling the transition from intersecting to not-intersecting; and an IntersectionObserverEntry signalling a transition from not-intersecting to intersecting with a zero-area intersection rect (as will happen with edge-adjacent intersections, or when the boundingClientRect has zero area).
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-isintersecting
source§fn IsVisible(&self) -> bool
fn IsVisible(&self) -> bool
Contains the result of running the visibility algorithm on target.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-isvisible
source§fn IntersectionRatio(&self) -> Finite<f64>
fn IntersectionRatio(&self) -> Finite<f64>
If the boundingClientRect has non-zero area, this will be the ratio of intersectionRect area to boundingClientRect area. Otherwise, this will be 1 if the isIntersecting is true, and 0 if not.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-intersectionratio
source§fn Target(&self) -> Root<Dom<Element>>
fn Target(&self) -> Root<Dom<Element>>
The Element whose intersection with the intersection root changed.
https://w3c.github.io/IntersectionObserver/#dom-intersectionobserverentry-target
source§fn Constructor(
window: &Window,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
init: &IntersectionObserverEntryInit,
) -> Root<Dom<IntersectionObserverEntry>>
fn Constructor( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, init: &IntersectionObserverEntryInit, ) -> Root<Dom<IntersectionObserverEntry>>
source§impl MallocSizeOf for IntersectionObserverEntry
impl MallocSizeOf for IntersectionObserverEntry
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl PartialEq for IntersectionObserverEntry
impl PartialEq for IntersectionObserverEntry
impl Eq for IntersectionObserverEntry
Auto Trait Implementations§
impl !Freeze for IntersectionObserverEntry
impl !RefUnwindSafe for IntersectionObserverEntry
impl !Send for IntersectionObserverEntry
impl !Sync for IntersectionObserverEntry
impl Unpin for IntersectionObserverEntry
impl !UnwindSafe for IntersectionObserverEntry
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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<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>
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>
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