embedder_traits::resources

Enum Resource

Source
pub enum Resource {
Show 15 variants BluetoothBlocklist, DomainList, HstsPreloadList, BadCertHTML, NetErrorHTML, UserAgentCSS, ServoCSS, PresentationalHintsCSS, QuirksModeCSS, RippyPNG, MediaControlsCSS, MediaControlsJS, CrashHTML, DirectoryListingHTML, AboutMemoryHTML,
}

Variants§

§

BluetoothBlocklist

A list of GATT services that are blocked from being used by web bluetooth. The format of the file is a list of UUIDs, one per line, with an optional second word to specify the type of blocklist. It can be empty but then all GATT services will be allowed.

§

DomainList

A list of domain names that are considered public suffixes, typically obtained from https://publicsuffix.org/list/. The Public Suffix List is a cross-vendor initiative to provide an accurate list of domain name suffixes that are under the control of a registry. This is used to prevent cookies from being set for top-level domains that are not controlled by the same entity as the website. It can be empty but all domain names will be considered not public suffixes.

§

HstsPreloadList

A preloaded list of HTTP Strict Transport Security. It can be an empty list and HstsList::default() will be called.

§

BadCertHTML

A HTML page to display when net_traits::NetworkError::SslValidation network error is reported. The page contains placeholder ${reason} for the error code and ${bytes} for the certificate bytes, and also ${secret} for the privileged secret. It can be empty but then nothing will be displayed when a certificate error occurs.

§

NetErrorHTML

A HTML page to display when any network error occurs that is not related to SSL validation. The message can contain a placeholder ${reason} for the error code. It can be empty but then nothing will be displayed when an internal error occurs.

§

UserAgentCSS

A CSS file to style the user agent stylesheet. It can be empty but then there’s simply no user agent stylesheet.

§

ServoCSS

A CSS file to style the Servo browser. It can be empty but several features might not work as expected.

§

PresentationalHintsCSS

A CSS file to style the presentational hints. It can be empty but then presentational hints will not be styled.

§

QuirksModeCSS

A CSS file to style the quirks mode. It can be empty but then quirks mode will not be styled.

§

RippyPNG

A placeholder image to display if we couldn’t get the requested image.

§Safety

Servo will crash if this is an invalid image. Check resources/rippy.png in Servo codebase to see what a default rippy png should look like.

§

MediaControlsCSS

A CSS file to style the media controls. It can be empty but then media controls will not be styled.

§

MediaControlsJS

A JS file to control the media controls. It can be empty but then media controls will not work.

§

CrashHTML

A placeholder HTML page to display when the code responsible for rendering a page panics and the original page can no longer be displayed. The message can contain a placeholder ${details} for the error details. It can be empty but then nothing will be displayed when a crash occurs.

§

DirectoryListingHTML

A HTML page to display when a directory listing is requested. The page contains a js function setData that will then be used to build the list of directory. It can be empty but then nothing will be displayed when a directory listing is requested.

§

AboutMemoryHTML

A HTML page that is used for the about:memory url.

Implementations§

Source§

impl Resource

Source

pub fn filename(&self) -> &'static str

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T