[][src]Struct stdweb::web::Storage

pub struct Storage(_);

The Storage interface of the Web Storage API provides access to the session storage or local storage for a particular domain.

(JavaScript docs)

Methods

impl Storage[src]

pub fn len(&self) -> u32[src]

Gets the number of data items stored in the Storage object.

(JavaScript docs)

pub fn get(&self, key: &str) -> Option<String>[src]

Returns a value corresponding to the key.

(JavaScript docs)

pub fn insert(&self, key: &str, value: &str) -> Result<(), TODO>[src]

Inserts a key-value pair into the storage.

(JavaScript docs)

pub fn remove(&self, key: &str)[src]

Removes a key from the storage.

(JavaScript docs)

pub fn clear(&self)[src]

When invoked, will empty all keys out of the storage.

(JavaScript docs)

pub fn key(&self, nth: u32) -> Option<String>[src]

Return the name of the nth key in the storage.

(JavaScript docs)

pub fn contains_key(&self, key: &str) -> bool[src]

Returns true if the storage contains a value for the specified key.

Trait Implementations

impl JsSerialize for Storage[src]

impl TryFrom<Storage> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for Storage[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for Storage[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for Storage[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for Storage[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for Storage[src]

impl ReferenceType for Storage[src]

impl AsRef<Reference> for Storage[src]

impl From<Storage> for Reference[src]

impl Clone for Storage[src]

impl Eq for Storage[src]

impl PartialEq<Storage> for Storage[src]

impl Debug for Storage[src]

Auto Trait Implementations

impl Send for Storage

impl Sync for Storage

impl Unpin for Storage

impl UnwindSafe for Storage

impl RefUnwindSafe for Storage

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]