pub struct RuleSetBuilder { /* private fields */ }Expand description
Builder for RuleSet.
Implementations§
Source§impl RuleSetBuilder
impl RuleSetBuilder
pub fn id<VALUE: Into<RuleSetId>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn loader_id<VALUE: Into<LoaderId>>(&mut self, value: VALUE) -> &mut Self
pub fn loader_id<VALUE: Into<LoaderId>>(&mut self, value: VALUE) -> &mut Self
Identifies a document which the rule set is associated with.
Sourcepub fn source_text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn source_text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
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:
Sourcepub fn backend_node_id<VALUE: Into<BackendNodeId>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn backend_node_id<VALUE: Into<BackendNodeId>>( &mut self, value: VALUE, ) -> &mut Self
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:
pub fn url<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn request_id<VALUE: Into<RequestId>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn error_type<VALUE: Into<RuleSetErrorType>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn error_type<VALUE: Into<RuleSetErrorType>>( &mut self, value: VALUE, ) -> &mut Self
Error information
errorMessage is null iff errorType is null.
Sourcepub fn error_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn error_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
TODO(https://crbug.com/1425354): Replace this property with structured error.
Sourcepub fn tag<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn tag<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
For more details, see: https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md
Trait Implementations§
Source§impl Clone for RuleSetBuilder
impl Clone for RuleSetBuilder
Source§fn clone(&self) -> RuleSetBuilder
fn clone(&self) -> RuleSetBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more