#[non_exhaustive]pub enum ValueGrammar {
SourceList,
AncestorSourceList,
SandboxTokens,
Boolean,
Token,
TokenList,
TrustedTypes,
}Expand description
Which value grammar a directive’s raw value should be parsed with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SourceList
serialized-source-list (CSP3 §2.3.1).
AncestorSourceList
frame-ancestors’ restricted ancestor-source-list: parsed with
the same crate::parse_source_list as SourceList, but only
scheme-source, host-source, and 'self' are valid there – see
ancestor_source_list_is_valid.
SandboxTokens
sandbox’s whitespace-separated, unquoted token list.
Boolean
No value expected (e.g. upgrade-insecure-requests).
Token
A single raw token (e.g. report-to, require-trusted-types-for).
TokenList
Whitespace-separated raw tokens with no further structure parsed
by this crate (e.g. report-uri‘s URI references, plugin-types’
MIME-type patterns – both grammars this crate deliberately does
not implement, matching the narrow, generic scope from
CLAUDE.md).
TrustedTypes
trusted-types’ policy-name list (plus the 'allow-duplicates'/
'none' sentinel tokens), kept as raw tokens for the same reason
as TokenList.
Trait Implementations§
Source§impl Clone for ValueGrammar
impl Clone for ValueGrammar
Source§fn clone(&self) -> ValueGrammar
fn clone(&self) -> ValueGrammar
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more