[−][src]Struct monaco::sys::Range
A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)
Implementations
impl Range
[src]
pub fn start_line_number(&self) -> f64
[src]
Line number on which the range starts (starts at 1).
impl Range
[src]
pub fn start_column(&self) -> f64
[src]
Column on which the range starts in line startLineNumber
(starts at
1).
impl Range
[src]
pub fn end_line_number(&self) -> f64
[src]
Line number on which the range ends.
impl Range
[src]
pub fn end_column(&self) -> f64
[src]
Column on which the range ends in line endLineNumber
.
impl Range
[src]
pub fn new(
start_line_number: f64,
start_column: f64,
end_line_number: f64,
end_column: f64
) -> Range
[src]
start_line_number: f64,
start_column: f64,
end_line_number: f64,
end_column: f64
) -> Range
impl Range
[src]
impl Range
[src]
pub fn is_empty_static(range: &IRange) -> bool
[src]
Test if range
is empty.
impl Range
[src]
pub fn contains_position(&self, position: &IPosition) -> bool
[src]
Test if position is in this range. If the position is at the edges, will return true.
impl Range
[src]
pub fn contains_position_static(range: &IRange, position: &IPosition) -> bool
[src]
Test if position
is in range
. If the position is at the edges, will
return true.
impl Range
[src]
pub fn contains_range(&self, range: &IRange) -> bool
[src]
Test if range is in this range. If the range is equal to this range, will return true.
impl Range
[src]
pub fn contains_range_static(range: &IRange, other_range: &IRange) -> bool
[src]
Test if otherRange
is in range
. If the ranges are equal, will return
true.
impl Range
[src]
pub fn strict_contains_range(&self, range: &IRange) -> bool
[src]
Test if range
is strictly in this range. range
must start after and
end before this range for the result to be true.
impl Range
[src]
pub fn strict_contains_range_static(
range: &IRange,
other_range: &IRange
) -> bool
[src]
range: &IRange,
other_range: &IRange
) -> bool
Test if otherRange
is strinctly in range
(must start after, and end
before). If the ranges are equal, will return false.
impl Range
[src]
pub fn plus_range(&self, range: &IRange) -> Range
[src]
A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.
impl Range
[src]
pub fn plus_range_static(a: &IRange, b: &IRange) -> Range
[src]
A reunion of the two ranges. The smallest position will be used as the start point, and the largest one as the end point.
impl Range
[src]
pub fn intersect_ranges(&self, range: &IRange) -> Option<Range>
[src]
A intersection of the two ranges.
impl Range
[src]
pub fn intersect_ranges_static(a: &IRange, b: &IRange) -> Option<Range>
[src]
A intersection of the two ranges.
impl Range
[src]
pub fn equals_range(&self, other: Option<&IRange>) -> bool
[src]
Test if this range equals other.
impl Range
[src]
pub fn equals_range_static(a: Option<&IRange>, b: Option<&IRange>) -> bool
[src]
Test if range a
equals b
.
impl Range
[src]
pub fn get_end_position(&self) -> Position
[src]
Return the end position (which will be after or equal to the start position)
impl Range
[src]
pub fn get_start_position(&self) -> Position
[src]
Return the start position (which will be before or equal to the end position)
impl Range
[src]
impl Range
[src]
pub fn set_end_position(&self, end_line_number: f64, end_column: f64) -> Range
[src]
Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
impl Range
[src]
pub fn set_start_position(
&self,
start_line_number: f64,
start_column: f64
) -> Range
[src]
&self,
start_line_number: f64,
start_column: f64
) -> Range
Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
impl Range
[src]
pub fn collapse_to_start(&self) -> Range
[src]
Create a new empty range using this range's start position.
impl Range
[src]
pub fn collapse_to_start_static(range: &IRange) -> Range
[src]
Create a new empty range using this range's start position.
impl Range
[src]
pub fn from_positions(start: &IPosition, end: &IPosition) -> Range
[src]
impl Range
[src]
impl Range
[src]
impl Range
[src]
pub fn are_intersecting_or_touching(a: &IRange, b: &IRange) -> bool
[src]
Test if the two ranges are touching in any way.
impl Range
[src]
pub fn are_intersecting(a: &IRange, b: &IRange) -> bool
[src]
Test if the two ranges are intersecting. If the ranges are touching it returns true.
impl Range
[src]
pub fn compare_ranges_using_starts(
a: Option<&IRange>,
b: Option<&IRange>
) -> f64
[src]
a: Option<&IRange>,
b: Option<&IRange>
) -> f64
A function that compares ranges, useful for sorting ranges It will first compare ranges on the startPosition and then on the endPosition
impl Range
[src]
pub fn compare_ranges_using_ends(a: &IRange, b: &IRange) -> f64
[src]
A function that compares ranges, useful for sorting ranges It will first compare ranges on the endPosition and then on the startPosition
impl Range
[src]
pub fn spans_multiple_lines(range: &IRange) -> bool
[src]
Test if the range spans multiple lines.
Methods from Deref<Target = JsValue>
pub const NULL: JsValue
[src]
pub const UNDEFINED: JsValue
[src]
pub const TRUE: JsValue
[src]
pub const FALSE: JsValue
[src]
pub fn as_f64(&self) -> Option<f64>
[src]
Returns the f64
value of this JS value if it's an instance of a
number.
If this JS value is not an instance of a number then this returns
None
.
pub fn is_string(&self) -> bool
[src]
Tests whether this JS value is a JS string.
pub fn as_string(&self) -> Option<String>
[src]
If this JS value is a string value, this function copies the JS string
value into wasm linear memory, encoded as UTF-8, and returns it as a
Rust String
.
To avoid the copying and re-encoding, consider the
JsString::try_from()
function from js-sys
instead.
If this JS value is not an instance of a string or if it's not valid
utf-8 then this returns None
.
UTF-16 vs UTF-8
JavaScript strings in general are encoded as UTF-16, but Rust strings
are encoded as UTF-8. This can cause the Rust string to look a bit
different than the JS string sometimes. For more details see the
documentation about the str
type which contains a few
caveats about the encodings.
pub fn as_bool(&self) -> Option<bool>
[src]
Returns the bool
value of this JS value if it's an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None
.
pub fn is_null(&self) -> bool
[src]
Tests whether this JS value is null
pub fn is_undefined(&self) -> bool
[src]
Tests whether this JS value is undefined
pub fn is_symbol(&self) -> bool
[src]
Tests whether the type of this JS value is symbol
pub fn is_object(&self) -> bool
[src]
Tests whether typeof self == "object" && self !== null
.
pub fn is_function(&self) -> bool
[src]
Tests whether the type of this JS value is function
.
pub fn is_truthy(&self) -> bool
[src]
Tests whether the value is "truthy".
pub fn is_falsy(&self) -> bool
[src]
Tests whether the value is "falsy".
Trait Implementations
impl AsRef<JsValue> for Range
[src]
impl AsRef<Range> for Range
[src]
impl AsRef<Range> for Selection
[src]
impl Debug for Range
[src]
impl Deref for Range
[src]
impl From<JsValue> for Range
[src]
impl From<Range> for JsValue
[src]
impl From<Selection> for Range
[src]
impl FromWasmAbi for Range
[src]
type Abi = <JsValue as FromWasmAbi>::Abi
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: Self::Abi) -> Self
[src]
impl IntoWasmAbi for Range
[src]
type Abi = <JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> Self::Abi
[src]
impl<'a> IntoWasmAbi for &'a Range
[src]
type Abi = <&'a JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> Self::Abi
[src]
impl JsCast for Range
[src]
fn instanceof(val: &JsValue) -> bool
[src]
fn unchecked_from_js(val: JsValue) -> Self
[src]
fn unchecked_from_js_ref(val: &JsValue) -> &Self
[src]
fn has_type<T>(&self) -> bool where
T: JsCast,
[src]
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
[src]
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
[src]
T: JsCast,
fn unchecked_into<T>(self) -> T where
T: JsCast,
[src]
T: JsCast,
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
[src]
T: JsCast,
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
[src]
T: JsCast,
fn is_type_of(val: &JsValue) -> bool
[src]
impl OptionFromWasmAbi for Range
[src]
impl OptionIntoWasmAbi for Range
[src]
impl<'a> OptionIntoWasmAbi for &'a Range
[src]
impl RefFromWasmAbi for Range
[src]
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self
are recovered from.
type Anchor = ManuallyDrop<Range>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl WasmDescribe for Range
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,