[−][src]Struct stdweb::web::History
Methods
impl History
[src]
impl History
pub fn push_state<T: JsSerialize>( | [src] |
Adds a new entry to history.
pushState() takes three parameters: a state object, a title (which is currently ignored), and (optionally) a URL. Let's examine each of these three parameters in more detail:
-
state object — The state object is a JavaScript object which is associated with the new history entry created by pushState(). Whenever the user navigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object.
-
title — Firefox currently ignores this parameter, although it may use it in the future. Passing the empty string here should be safe against future changes to the method. Alternatively, you could pass a short title for the state to which you're moving.
-
URL — The new history entry's URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to pushState(), but it might attempt to load the URL later, for instance after the user restarts the browser. The new URL does not need to be absolute; if it's relative, it's resolved relative to the current URL. The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception. This parameter is optional; if it isn't specified, it's set to the document's current URL.
pub fn replace_state<T: JsSerialize>( | [src] |
Operates exactly like history.push_state() except that replace_state() modifies the current history entry instead of creating a new one. Note that this doesn't prevent the creation of a new entry in the global browser history.
pub fn go(&self, offset: i32) -> Result<(), TODO> | [src] |
You can use the go() method to load a specific page from session history, identified by its relative position to the current page (with the current page being, of course, relative index 0).
pub fn back(&self) -> Result<(), TODO> | [src] |
Move one step backward through history.
pub fn forward(&self) -> Result<(), TODO> | [src] |
Move one step forward through history.
pub fn len(&self) -> u32 | [src] |
Returns the current number of history entries.
Trait Implementations
impl JsSerialize for History
[src]
impl JsSerialize for History
impl TryFrom<History> for Reference
[src]
impl TryFrom<History> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: History) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Reference> for History
[src]
impl TryFrom<Reference> for History
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error> | [src] |
impl<'_r> TryFrom<&'_r Reference> for History
[src]
impl<'_r> TryFrom<&'_r Reference> for History
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Value> for History
[src]
impl TryFrom<Value> for History
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error> | [src] |
impl<'_r> TryFrom<&'_r Value> for History
[src]
impl<'_r> TryFrom<&'_r Value> for History
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error> | [src] |
impl InstanceOf for History
[src]
impl InstanceOf for History
fn instance_of(reference: &Reference) -> bool | [src] |
impl ReferenceType for History
[src]
impl ReferenceType for History
unsafe fn from_reference_unchecked(reference: Reference) -> Self | [src] |
impl From<History> for Reference
[src]
impl From<History> for Reference
impl Eq for History
[src]
impl Eq for History
impl PartialEq<History> for History
[src]
impl PartialEq<History> for History
impl AsRef<Reference> for History
[src]
impl AsRef<Reference> for History
impl Clone for History
[src]
impl Clone for History
fn clone(&self) -> History | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Debug for History
[src]
impl Debug for History
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |