#[repr(C)]pub struct Range {
reflector_: Reflector,
start: BoundaryPoint,
end: BoundaryPoint,
associated_selections: DomRefCell<Vec<Dom<Selection>>>,
}
Fields
reflector_: Reflector
start: BoundaryPoint
end: BoundaryPoint
associated_selections: DomRefCell<Vec<Dom<Selection>>>
Implementations
sourceimpl Range
impl Range
fn __assert_parent_type(&self)
sourceimpl Range
impl Range
fn new_inherited(
start_container: &Node,
start_offset: u32,
end_container: &Node,
end_offset: u32
) -> Range
pub fn new_with_doc(document: &Document) -> Root<Dom<Range>>
pub fn new(
document: &Document,
start_container: &Node,
start_offset: u32,
end_container: &Node,
end_offset: u32
) -> Root<Dom<Range>>
pub fn Constructor(window: &Window) -> Result<Root<Dom<Range>>, Error>
fn contains(&self, node: &Node) -> bool
fn partially_contains(&self, node: &Node) -> bool
fn contained_children(
&self
) -> Result<(Option<Root<Dom<Node>>>, Option<Root<Dom<Node>>>, Vec<Root<Dom<Node>>>), Error>
fn set_start(&self, node: &Node, offset: u32)
fn set_end(&self, node: &Node, offset: u32)
fn compare_point(&self, node: &Node, offset: u32) -> Result<Ordering, Error>
pub fn associate_selection(&self, selection: &Selection)
pub fn disassociate_selection(&self, selection: &Selection)
fn report_change(&self)
Trait Implementations
sourceimpl DomObjectWrap for Range
impl DomObjectWrap for Range
sourceconst WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::RangeBinding::RangeBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::range::Range>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::range::Range>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::RangeBinding::RangeBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::range::Range>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::range::Range>>}
Function pointer to the general wrap function type
sourceimpl IDLInterface for Range
impl IDLInterface for Range
sourceimpl MallocSizeOf for Range
impl MallocSizeOf for Range
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself. Read more
sourceimpl MutDomObject for Range
impl MutDomObject for Range
sourceunsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
sourceimpl RangeMethods for Range
impl RangeMethods for Range
fn StartContainer(&self) -> Root<Dom<Node>>
fn StartOffset(&self) -> u32
fn EndContainer(&self) -> Root<Dom<Node>>
fn EndOffset(&self) -> u32
fn Collapsed(&self) -> bool
fn CommonAncestorContainer(&self) -> Root<Dom<Node>>
fn SetStart(&self, node: &Node, offset: u32) -> Result<(), Error>
fn SetEnd(&self, node: &Node, offset: u32) -> Result<(), Error>
fn SetStartBefore(&self, node: &Node) -> Result<(), Error>
fn SetStartAfter(&self, node: &Node) -> Result<(), Error>
fn SetEndBefore(&self, node: &Node) -> Result<(), Error>
fn SetEndAfter(&self, node: &Node) -> Result<(), Error>
fn Collapse(&self, to_start: bool)
fn SelectNode(&self, node: &Node) -> Result<(), Error>
fn SelectNodeContents(&self, node: &Node) -> Result<(), Error>
fn CompareBoundaryPoints(&self, how: u16, other: &Range) -> Result<i16, Error>
fn CloneRange(&self) -> Root<Dom<Range>>
fn IsPointInRange(&self, node: &Node, offset: u32) -> Result<bool, Error>
fn ComparePoint(&self, node: &Node, offset: u32) -> Result<i16, Error>
fn IntersectsNode(&self, node: &Node) -> bool
fn CloneContents(&self) -> Result<Root<Dom<DocumentFragment>>, Error>
fn ExtractContents(&self) -> Result<Root<Dom<DocumentFragment>>, Error>
fn Detach(&self)
fn InsertNode(&self, node: &Node) -> Result<(), Error>
fn DeleteContents(&self) -> Result<(), Error>
fn SurroundContents(&self, new_parent: &Node) -> Result<(), Error>
fn Stringifier(&self) -> DOMString
fn CreateContextualFragment(
&self,
fragment: DOMString
) -> Result<Root<Dom<DocumentFragment>>, Error>
sourceimpl ToJSValConvertible for Range
impl ToJSValConvertible for Range
sourceunsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
Convert
self
to a JSVal
. JSAPI failure causes a panic.Auto Trait Implementations
impl !RefUnwindSafe for Range
impl !Send for Range
impl !Sync for Range
impl Unpin for Range
impl !UnwindSafe for Range
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
sourcefn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
sourceimpl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
sourcefn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert