[−][src]Struct localghost::Location
Representation of the location (URL) of the object it is linked to.
Implementations
impl Location
[src]
pub fn new() -> Self
[src]
Create a new instance of Location
by reading document.location
.
pub fn href(&self) -> String
[src]
Access the URL at the current location.
pub fn assign(&self, url: &str) -> Result<()>
[src]
Loads the resource at the URL provided in parameter.
Errors
An error may be returned if the url is malformed.
pub fn replace(&self, url: &str) -> Result<()>
[src]
Replaces the current resource with the one at the provided URL.
The difference from the assign
method is that after using replace
the
current page will not be saved in session History
, meaning the user
won't be able to use the back button to navigate to it
Errors
An error may be returned if the url is malformed.
pub fn reload(&self) -> Result<()>
[src]
Reloads the current URL, like the Refresh button.
Errors
An error may be returned if the origin of the script calling reload
differs from the origin of the page that owns the Location
object.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Location
impl !Send for Location
impl !Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,