pub struct RuleSet {
pub id: RuleSetId,
pub loader_id: LoaderId,
pub source_text: String,
pub backend_node_id: Option<BackendNodeId>,
pub url: Option<String>,
pub request_id: Option<RequestId>,
pub error_type: Option<RuleSetErrorType>,
}
Expand description
Corresponds to SpeculationRuleSet RuleSet
Fields§
§id: RuleSetId
§loader_id: LoaderId
Identifies a document which the rule set is associated with.
source_text: String
Source text of JSON representing the rule set. If it comes from
<script>
tag, it is the textContent of the node. Note that it is
a JSON for valid case.
See also:
- https://wicg.github.io/nav-speculation/speculation-rules.html
- https://github.com/WICG/nav-speculation/blob/main/triggers.md
backend_node_id: Option<BackendNodeId>
A speculation rule set is either added through an inline
<script>
tag or through an external resource via the
‘Speculation-Rules’ HTTP header. For the first case, we include
the BackendNodeId of the relevant <script>
tag. For the second
case, we include the external URL where the rule set was loaded
from, and also RequestId if Network domain is enabled.
See also:
- https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-script
- https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-header
url: Option<String>
§request_id: Option<RequestId>
§error_type: Option<RuleSetErrorType>
Error information
errorMessage
is null iff errorType
is null.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleSet
impl<'de> Deserialize<'de> for RuleSet
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RuleSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RuleSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for RuleSet
impl Serialize for RuleSet
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for RuleSet
Auto Trait Implementations§
impl Freeze for RuleSet
impl RefUnwindSafe for RuleSet
impl Send for RuleSet
impl Sync for RuleSet
impl Unpin for RuleSet
impl UnwindSafe for RuleSet
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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