Enum Origin
enum Origin
The origin of an URL
Two URLs with the same origin are considered to originate from the same entity and can therefore trust each other.
The origin is determined based on the scheme as follows:
- If the scheme is "blob" the origin is the origin of the URL contained in the path component. If parsing fails, it is an opaque origin.
- If the scheme is "ftp", "http", "https", "ws", or "wss", then the origin is a tuple of the scheme, host, and port.
- If the scheme is anything else, the origin is opaque, meaning the URL does not have the same origin as any other URL.
For more information see https://url.spec.whatwg.org/#origin
Variants
-
Opaque(OpaqueOrigin) A globally unique identifier
-
Tuple(alloc::string::String, crate::host::Host<alloc::string::String>, u16) Consists of the URL's scheme, host and port
Implementations
impl Origin
fn new_opaque() -> OriginCreates a new opaque origin that is only equal to itself.
fn is_tuple(self: &Self) -> boolReturn whether this origin is a (scheme, host, port) tuple (as opposed to an opaque origin).
fn ascii_serialization(self: &Self) -> Stringhttps://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin
fn unicode_serialization(self: &Self) -> Stringhttps://html.spec.whatwg.org/multipage/#unicode-serialisation-of-an-origin
impl Clone for Origin
fn clone(self: &Self) -> Origin
impl Debug for Origin
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Origin
impl Freeze for Origin
impl Hash for Origin
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl PartialEq for Origin
fn eq(self: &Self, other: &Origin) -> bool
impl RefUnwindSafe for Origin
impl Send for Origin
impl StructuralPartialEq for Origin
impl Sync for Origin
impl Unpin for Origin
impl UnsafeUnpin for Origin
impl UnwindSafe for Origin
impl<T> Any for Origin
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Origin
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Origin
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Origin
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for Origin
impl<T> From for Origin
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Origin
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Origin
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Origin
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Origin
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>