Struct stdweb::web::Storage [−][src]
pub struct Storage(_);
The Storage
interface of the Web Storage API provides access to
the session storage or local storage for a particular domain.
Methods
impl Storage
[src]
impl Storage
pub fn len(&self) -> u32
[src]
pub fn len(&self) -> u32
Gets the number of data items stored in the Storage
object.
pub fn get(&self, key: &str) -> Option<String>
[src]
pub fn get(&self, key: &str) -> Option<String>
Returns a value corresponding to the key.
pub fn insert(&self, key: &str, value: &str) -> Result<(), TODO>
[src]
pub fn insert(&self, key: &str, value: &str) -> Result<(), TODO>
Inserts a key-value pair into the storage.
pub fn remove(&self, key: &str)
[src]
pub fn remove(&self, key: &str)
Removes a key from the storage.
pub fn clear(&self)
[src]
pub fn clear(&self)
When invoked, will empty all keys out of the storage.
pub fn key(&self, nth: u32) -> Option<String>
[src]
pub fn key(&self, nth: u32) -> Option<String>
Return the name of the nth key in the storage.
pub fn contains_key(&self, key: &str) -> bool
[src]
pub fn contains_key(&self, key: &str) -> bool
Returns true if the storage contains a value for the specified key.
Trait Implementations
impl Clone for Storage
[src]
impl Clone for Storage
fn clone(&self) -> Storage
[src]
fn clone(&self) -> Storage
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Storage
[src]
impl Debug for Storage
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Storage
[src]
impl PartialEq for Storage
fn eq(&self, other: &Storage) -> bool
[src]
fn eq(&self, other: &Storage) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Storage) -> bool
[src]
fn ne(&self, other: &Storage) -> bool
This method tests for !=
.
impl Eq for Storage
[src]
impl Eq for Storage
impl InstanceOf for Storage
[src]
impl InstanceOf for Storage
fn instance_of(reference: &Reference) -> bool
[src]
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
impl AsRef<Reference> for Storage
[src]
impl AsRef<Reference> for Storage
impl ReferenceType for Storage
[src]
impl ReferenceType for Storage
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl From<Storage> for Reference
[src]
impl From<Storage> for Reference
impl TryFrom<Storage> for Reference
[src]
impl TryFrom<Storage> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: Storage) -> Result<Self, Self::Error>
[src]
fn try_from(value: Storage) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Reference> for Storage
[src]
impl TryFrom<Reference> for Storage
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for Storage
[src]
impl<'_r> TryFrom<&'_r Reference> for Storage
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
Performs the conversion.
impl TryFrom<Value> for Storage
[src]
impl TryFrom<Value> for Storage
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: Value) -> Result<Self, Self::Error>
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for Storage
[src]
impl<'_r> TryFrom<&'_r Value> for Storage
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
fn try_from(value: &Value) -> Result<Self, Self::Error>
Performs the conversion.
impl JsSerialize for Storage
[src]
impl JsSerialize for Storage