pub struct KeyRange { /* private fields */ }Expand description
Represents a continuous interval over some data type that is used for keys.
Implementations
sourceimpl KeyRange
impl KeyRange
sourcepub fn bound(
lower: &JsValue,
upper: &JsValue,
lower_open: Option<bool>,
upper_open: Option<bool>
) -> Result<Self, Error>
pub fn bound(
lower: &JsValue,
upper: &JsValue,
lower_open: Option<bool>,
upper_open: Option<bool>
) -> Result<Self, 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<Self, Error>
pub fn lower_bound(
lower: &JsValue,
lower_open: Option<bool>
) -> Result<Self, 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<Self, Error>
pub fn upper_bound(
upper: &JsValue,
upper_open: Option<bool>
) -> Result<Self, 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
sourceimpl From<IdbKeyRange> for KeyRange
impl From<IdbKeyRange> for KeyRange
sourcefn from(inner: IdbKeyRange) -> Self
fn from(inner: IdbKeyRange) -> Self
Converts to this type from the input type.
sourceimpl From<KeyRange> for IdbKeyRange
impl From<KeyRange> for IdbKeyRange
impl Eq for KeyRange
impl StructuralEq for KeyRange
impl StructuralPartialEq for KeyRange
Auto Trait Implementations
impl RefUnwindSafe for KeyRange
impl !Send for KeyRange
impl !Sync for KeyRange
impl Unpin for KeyRange
impl UnwindSafe for KeyRange
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