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:

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() -> Origin

Creates a new opaque origin that is only equal to itself.

fn is_tuple(self: &Self) -> bool

Return whether this origin is a (scheme, host, port) tuple (as opposed to an opaque origin).

fn ascii_serialization(self: &Self) -> String

https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin

fn unicode_serialization(self: &Self) -> String

https://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) -> T

Returns the argument unchanged.

impl<T> ToOwned for Origin

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Origin

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>