pub struct KeyRange { /* private fields */ }
Expand description
Represents a continuous interval over some data type that is used for keys.
Implementations§
Source§impl KeyRange
impl KeyRange
Sourcepub fn only(value: &JsValue) -> Result<KeyRange, Error>
pub fn only(value: &JsValue) -> Result<KeyRange, Error>
Returns a new KeyRange
spanning only key.
Sourcepub fn bound(
lower: &JsValue,
upper: &JsValue,
lower_open: Option<bool>,
upper_open: Option<bool>,
) -> Result<KeyRange, Error>
pub fn bound( lower: &JsValue, upper: &JsValue, lower_open: Option<bool>, upper_open: Option<bool>, ) -> Result<KeyRange, Error>
Returns a new KeyRange
spanning from lower to upper. If lower_open
is true, lower
is not included in the
range. If upper_open
is true, upper
is not included in the range.
Sourcepub fn lower_bound(
lower: &JsValue,
lower_open: Option<bool>,
) -> Result<KeyRange, Error>
pub fn lower_bound( lower: &JsValue, lower_open: Option<bool>, ) -> Result<KeyRange, Error>
Returns a new KeyRange
starting at key with no upper bound. If lower_open
is true, key is not included in
the range.
Sourcepub fn upper_bound(
upper: &JsValue,
upper_open: Option<bool>,
) -> Result<KeyRange, Error>
pub fn upper_bound( upper: &JsValue, upper_open: Option<bool>, ) -> Result<KeyRange, Error>
Returns a new KeyRange
with no lower bound and ending at key. If upper_open
is true, key is not included
in the range.
Sourcepub fn lower(&self) -> Result<JsValue, Error>
pub fn lower(&self) -> Result<JsValue, Error>
Returns the range’s lower bound, or undefined if none.
Sourcepub fn upper(&self) -> Result<JsValue, Error>
pub fn upper(&self) -> Result<JsValue, Error>
Returns the range’s upper bound, or undefined if none.
Sourcepub fn lower_open(&self) -> bool
pub fn lower_open(&self) -> bool
Returns the range’s lower open flag.
Sourcepub fn upper_open(&self) -> bool
pub fn upper_open(&self) -> bool
Returns the range’s upper open flag.
Trait Implementations§
Source§impl From<IdbKeyRange> for KeyRange
impl From<IdbKeyRange> for KeyRange
Source§fn from(inner: IdbKeyRange) -> KeyRange
fn from(inner: IdbKeyRange) -> KeyRange
Converts to this type from the input type.
impl Eq for KeyRange
impl StructuralPartialEq for KeyRange
Auto Trait Implementations§
impl Freeze for KeyRange
impl RefUnwindSafe for KeyRange
impl !Send for KeyRange
impl !Sync for KeyRange
impl Unpin for KeyRange
impl UnwindSafe for KeyRange
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