pub struct Resource {
pub name: String,
pub aliases: Vec<String>,
pub kind: ResourceType,
pub content: String,
pub dependencies: Vec<String>,
pub permission: PermissionMask,
}
Expand description
Struct representing a resource that can be used by an adblocking engine.
Fields§
§name: String
Represents the primary name of the resource, often a filename
aliases: Vec<String>
Represents secondary names that can be used to access the resource
kind: ResourceType
How to interpret the resource data within content
content: String
The resource data, encoded using standard base64 configuration
dependencies: Vec<String>
Optionally contains the name of any dependencies used by this resource. Currently, this
only applies to application/javascript
and fn/javascript
MIME types.
Aliases should never be added to this list. It should only contain primary/canonical resource names.
permission: PermissionMask
Optionally defines permission levels required to use this resource for a scriptlet
injection. See PermissionMask
for more details.
If there is any customized permission, this resource cannot be used for redirects.
This field is similar to the requiresTrust
field from uBlock Origin’s scriptlet
resources, except that it supports up to 8 different trust “domains”.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)