pub struct URL<'js> { /* private fields */ }Expand description
Represents a JavaScript
URL as defined
by the WHATWG URL standard.
Implementations§
Source§impl<'js> URL<'js>
impl<'js> URL<'js>
pub const js_can_parse: __impl_can_parse = __impl_can_parse
pub const js_parse: __impl_parse = __impl_parse
pub const js_to_json: __impl_to_json = __impl_to_json
pub const js_to_string: __impl_to_string = __impl_to_string
Source§impl<'js> URL<'js>
impl<'js> URL<'js>
pub fn can_parse( ctx: Ctx<'js>, input: Value<'js>, base: Opt<Value<'js>>, ) -> bool
pub fn parse( ctx: Ctx<'js>, input: Value<'js>, base: Opt<Value<'js>>, ) -> Result<Value<'js>>
pub fn to_json(&self) -> String
pub fn to_string(&self) -> String
pub fn pathname(&self) -> String
pub fn set_pathname(&mut self, pathname: Coerced<String>) -> String
pub fn search_params(&self) -> &Value<'js>
pub fn hostname(&self) -> String
pub fn set_hostname(&mut self, hostname: Coerced<String>) -> String
pub fn password(&self) -> String
pub fn set_password(&mut self, password: Coerced<String>) -> String
pub fn host(&self) -> String
pub fn set_host(&mut self, host: Coerced<String>) -> String
pub fn username(&self) -> String
pub fn set_username(&mut self, username: Coerced<String>) -> String
pub fn origin(&self) -> String
pub fn href(&self) -> String
pub fn set_href(&mut self, href: String) -> String
pub fn port(&self) -> String
pub fn set_port(&mut self, ctx: Ctx<'js>, port: Value<'js>) -> Value<'js>
pub fn protocol(&self) -> String
pub fn set_protocol(&mut self, protocol: Coerced<String>) -> String
pub fn hash(&self) -> String
pub fn set_hash(&mut self, hash: String) -> String
pub fn search(&self) -> String
pub fn set_search(&mut self, search: Coerced<String>) -> String
pub fn to_string_tag() -> &'static str
pub fn new( ctx: Ctx<'js>, input: Value<'js>, base: Opt<Value<'js>>, ) -> Result<Self>
Trait Implementations§
Source§impl<'js> ConstructorCreator<'js, URL<'js>> for ConstructorCreate<URL<'js>>
impl<'js> ConstructorCreator<'js, URL<'js>> for ConstructorCreate<URL<'js>>
fn create_constructor(&self, ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Source§impl<'js> JsClass<'js> for URL<'js>
impl<'js> JsClass<'js> for URL<'js>
Source§fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Returns a predefined constructor for this specific class type if there is one.
Source§fn call<'a>(
this: &JsCell<'js, Self>,
params: Params<'a, 'js>,
) -> Result<Value<'js>, Error>
fn call<'a>( this: &JsCell<'js, Self>, params: Params<'a, 'js>, ) -> Result<Value<'js>, Error>
The function which will be called if
Self::KIND is ClassKind::Callable and an object with this
class is called as if it is a function.Source§fn exotic_get_property(
this: &JsCell<'js, Self>,
ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
) -> Result<Value<'js>, Error>
fn exotic_get_property( this: &JsCell<'js, Self>, ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, ) -> Result<Value<'js>, Error>
The function which will be called if a get property is performed on an object with this class
Source§fn exotic_set_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
_value: Value<'js>,
) -> Result<bool, Error>
fn exotic_set_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, _value: Value<'js>, ) -> Result<bool, Error>
The function which will be called if a set property is performed on an object with this class
Source§fn exotic_delete_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_delete_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if a delete property is performed on an object with this class
Source§fn exotic_has_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_has_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if has property or similar is called on an object with this class
Source§fn exotic_get_own_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<Option<PropertyDescriptor<'js>>, Error>
fn exotic_get_own_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<Option<PropertyDescriptor<'js>>, Error>
Called to get the own property descriptor for a given property name. Read more
Source§fn exotic_get_own_property_names(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
) -> Result<Vec<PropertyName<'js>>, Error>
fn exotic_get_own_property_names( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, ) -> Result<Vec<PropertyName<'js>>, Error>
Called to enumerate the own property names of this object. Read more
Source§impl<'js> JsLifetime<'js> for URL<'js>
impl<'js> JsLifetime<'js> for URL<'js>
Auto Trait Implementations§
impl<'js> !RefUnwindSafe for URL<'js>
impl<'js> !Send for URL<'js>
impl<'js> !Sync for URL<'js>
impl<'js> !UnwindSafe for URL<'js>
impl<'js> Freeze for URL<'js>
impl<'js> Unpin for URL<'js>
impl<'js> UnsafeUnpin for URL<'js>
Blanket Implementations§
Source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
Source§fn param_requirement() -> ParamRequirement
fn param_requirement() -> ParamRequirement
The parameters requirements this value requires.
Source§fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
Convert from a parameter value.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more