Enum Origin

pub 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(String, Host<String>, u16)

Consists of the URL's scheme, host and port

Implementations

impl Origin

fn new_opaque() -> Self

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

fn is_tuple(&self) -> bool

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

fn ascii_serialization(&self) -> String

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

fn unicode_serialization(&self) -> String

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

Trait Implementations

impl Clone for Origin

fn clone(&self) -> Self

impl Debug for Origin

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for Origin

impl Hash for Origin

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for Origin

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for Origin

Auto Trait Implementations

impl Freeze for Origin

impl RefUnwindSafe for Origin

impl Send for Origin

impl Sync for Origin

impl Unpin for Origin

impl UnsafeUnpin for Origin

impl UnwindSafe for Origin

Blanket Implementations

impl<T> Any for Origin where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Origin where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Origin where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Origin where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Origin

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Origin where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Origin where U: From<T>,

fn into(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<U> for Origin where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Origin where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>