Struct SourceList
pub struct SourceList { /* private fields */ }http only.Expand description
Ordered list of SourceExpressions — the value of one CSP
directive.
Builder methods come in two flavours: with_* consumes self and
returns Self for chaining; set_* / add
mutate in place.
Implementations§
§impl SourceList
impl SourceList
pub const fn empty() -> SourceList
pub const fn empty() -> SourceList
Empty list — for directives like upgrade-insecure-requests
that carry no source value.
pub fn none() -> SourceList
pub fn none() -> SourceList
'none'-only list. Per spec must not be combined with any
other source.
pub fn self_origin() -> SourceList
pub fn self_origin() -> SourceList
'self'-only list. Equivalent to
SourceList::empty().with_self_keyword().
pub fn as_slice(&self) -> &[SourceExpression]
pub fn as_slice(&self) -> &[SourceExpression]
Borrow the underlying sources in declared (emit) order.
pub fn iter(&self) -> Iter<'_, SourceExpression> ⓘ
pub fn iter(&self) -> Iter<'_, SourceExpression> ⓘ
Iterate sources in declared (emit) order.
pub fn with(self, expr: SourceExpression) -> SourceList
pub fn with(self, expr: SourceExpression) -> SourceList
Push any source expression and return Self.
pub fn add(&mut self, expr: SourceExpression) -> &mut SourceList
pub fn add(&mut self, expr: SourceExpression) -> &mut SourceList
Push any source expression in place.
pub fn with_self_keyword(self) -> SourceList
pub fn with_self_keyword(self) -> SourceList
Append the 'self' keyword.
pub fn set_self_keyword(&mut self) -> &mut SourceList
pub fn set_self_keyword(&mut self) -> &mut SourceList
Append the 'self' keyword.
pub fn with_unsafe_inline(self) -> SourceList
pub fn with_unsafe_inline(self) -> SourceList
Append the 'unsafe-inline' keyword.
pub fn set_unsafe_inline(&mut self) -> &mut SourceList
pub fn set_unsafe_inline(&mut self) -> &mut SourceList
Append the 'unsafe-inline' keyword.
pub fn with_unsafe_eval(self) -> SourceList
pub fn with_unsafe_eval(self) -> SourceList
Append the 'unsafe-eval' keyword.
pub fn set_unsafe_eval(&mut self) -> &mut SourceList
pub fn set_unsafe_eval(&mut self) -> &mut SourceList
Append the 'unsafe-eval' keyword.
pub fn with_strict_dynamic(self) -> SourceList
pub fn with_strict_dynamic(self) -> SourceList
Append the 'strict-dynamic' keyword.
pub fn set_strict_dynamic(&mut self) -> &mut SourceList
pub fn set_strict_dynamic(&mut self) -> &mut SourceList
Append the 'strict-dynamic' keyword.
pub fn with_wasm_unsafe_eval(self) -> SourceList
pub fn with_wasm_unsafe_eval(self) -> SourceList
Append the 'wasm-unsafe-eval' keyword.
pub fn set_wasm_unsafe_eval(&mut self) -> &mut SourceList
pub fn set_wasm_unsafe_eval(&mut self) -> &mut SourceList
Append the 'wasm-unsafe-eval' keyword.
pub fn with_report_sample(self) -> SourceList
pub fn with_report_sample(self) -> SourceList
Append the 'report-sample' keyword.
pub fn set_report_sample(&mut self) -> &mut SourceList
pub fn set_report_sample(&mut self) -> &mut SourceList
Append the 'report-sample' keyword.
pub fn with_wildcard(self) -> SourceList
pub fn with_wildcard(self) -> SourceList
Append the * wildcard.
pub fn set_wildcard(&mut self) -> &mut SourceList
pub fn set_wildcard(&mut self) -> &mut SourceList
Append the * wildcard.
pub fn with_data(self) -> SourceList
pub fn with_data(self) -> SourceList
Append the data: scheme.
pub fn set_data(&mut self) -> &mut SourceList
pub fn set_data(&mut self) -> &mut SourceList
Append the data: scheme.
pub fn with_blob(self) -> SourceList
pub fn with_blob(self) -> SourceList
Append the blob: scheme.
pub fn set_blob(&mut self) -> &mut SourceList
pub fn set_blob(&mut self) -> &mut SourceList
Append the blob: scheme.
pub fn with_scheme(self, scheme: Protocol) -> SourceList
pub fn with_scheme(self, scheme: Protocol) -> SourceList
Append a Protocol as a scheme source (<scheme>:).
pub fn set_scheme(&mut self, scheme: Protocol) -> &mut SourceList
pub fn set_scheme(&mut self, scheme: Protocol) -> &mut SourceList
Append a Protocol as a scheme source (<scheme>:).
pub fn with_host(self, host: impl Into<HostSource>) -> SourceList
pub fn with_host(self, host: impl Into<HostSource>) -> SourceList
Append a HostSource (or anything convertible into one —
Domain, a &str via HostSource::try_parse etc.).
pub fn set_host(&mut self, host: impl Into<HostSource>) -> &mut SourceList
pub fn set_host(&mut self, host: impl Into<HostSource>) -> &mut SourceList
Append a HostSource (or anything convertible into one —
Domain, a &str via HostSource::try_parse etc.).
pub fn with_domain(self, domain: Domain) -> SourceList
pub fn with_domain(self, domain: Domain) -> SourceList
Append a bare-domain host source (no scheme, port, or path).
pub fn set_domain(&mut self, domain: Domain) -> &mut SourceList
pub fn set_domain(&mut self, domain: Domain) -> &mut SourceList
Append a bare-domain host source (no scheme, port, or path).
pub fn with_nonce(self, nonce: impl Into<Cow<'static, str>>) -> SourceList
pub fn with_nonce(self, nonce: impl Into<Cow<'static, str>>) -> SourceList
Append a 'nonce-<base64>' source.
pub fn set_nonce(
&mut self,
nonce: impl Into<Cow<'static, str>>,
) -> &mut SourceList
pub fn set_nonce( &mut self, nonce: impl Into<Cow<'static, str>>, ) -> &mut SourceList
Append a 'nonce-<base64>' source.
pub fn with_hash(
self,
algorithm: HashAlgorithm,
value: impl Into<Cow<'static, str>>,
) -> SourceList
pub fn with_hash( self, algorithm: HashAlgorithm, value: impl Into<Cow<'static, str>>, ) -> SourceList
Append a '<algo>-<base64>' source.
pub fn set_hash(
&mut self,
algorithm: HashAlgorithm,
value: impl Into<Cow<'static, str>>,
) -> &mut SourceList
pub fn set_hash( &mut self, algorithm: HashAlgorithm, value: impl Into<Cow<'static, str>>, ) -> &mut SourceList
Append a '<algo>-<base64>' source.
Trait Implementations§
§impl Clone for SourceList
impl Clone for SourceList
§fn clone(&self) -> SourceList
fn clone(&self) -> SourceList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SourceList
impl Debug for SourceList
§impl Default for SourceList
impl Default for SourceList
§fn default() -> SourceList
fn default() -> SourceList
§impl Display for SourceList
impl Display for SourceList
§impl From<SourceExpression> for SourceList
impl From<SourceExpression> for SourceList
§fn from(expr: SourceExpression) -> SourceList
fn from(expr: SourceExpression) -> SourceList
§impl<T> FromIterator<T> for SourceListwhere
T: Into<SourceExpression>,
impl<T> FromIterator<T> for SourceListwhere
T: Into<SourceExpression>,
§fn from_iter<I>(iter: I) -> SourceListwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> SourceListwhere
I: IntoIterator<Item = T>,
§impl PartialEq for SourceList
impl PartialEq for SourceList
impl Eq for SourceList
impl StructuralPartialEq for SourceList
Auto Trait Implementations§
impl Freeze for SourceList
impl RefUnwindSafe for SourceList
impl Send for SourceList
impl Sync for SourceList
impl Unpin for SourceList
impl UnsafeUnpin for SourceList
impl UnwindSafe for SourceList
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer