Skip to main content

CacheConfig

Struct CacheConfig 

Source
pub struct CacheConfig {
    pub path: Option<String>,
    pub cmn_ttl_s: u64,
    pub key_trust_ttl_s: u64,
    pub key_trust_refresh_mode: KeyTrustRefreshMode,
    pub key_trust_synapse_witness_mode: SynapseWitnessMode,
    pub spore_max_download_bytes: u64,
    pub spore_max_extract_bytes: u64,
    pub spore_max_extract_files: u64,
    pub spore_max_extract_file_bytes: u64,
    pub spore_reject_path_components: Vec<String>,
    pub clock_skew_tolerance_s: u64,
    pub require_domain_first_key: bool,
}

Fields§

§path: Option<String>

Custom cache directory path (default: $CMN_HOME/hypha/cache/)

§cmn_ttl_s: u64

cmn.json cache TTL in seconds (default: 300 = 5 minutes)

§key_trust_ttl_s: u64

Key trust cache TTL in seconds (default: 604800 = 7 days)

§key_trust_refresh_mode: KeyTrustRefreshMode

Key trust refresh strategy (default: expired)

§key_trust_synapse_witness_mode: SynapseWitnessMode

Key trust fallback policy when domain is unreachable (default: allow)

§spore_max_download_bytes: u64

Maximum spore archive HTTP response body size in bytes (default: 1 GB)

§spore_max_extract_bytes: u64

Maximum total bytes to extract from a spore archive (default: 512 MB)

§spore_max_extract_files: u64

Maximum number of files to extract from a spore archive (default: 100_000)

§spore_max_extract_file_bytes: u64

Maximum size of a single file in a spore archive in bytes (default: 256 MB)

§spore_reject_path_components: Vec<String>

Path components rejected when receiving spore content.

§clock_skew_tolerance_s: u64

Clock skew tolerance in seconds for key trust TTL checks (default: 300 = 5 minutes). Adds a grace period to prevent false “key_untrusted” errors caused by clock drift between the local machine and the publishing domain.

§require_domain_first_key: bool

Whether the initial key for a domain must come from the domain itself (TOFU). true = more secure, first contact requires domain to be online. false = allows synapse to provide initial key (less secure).

Trait Implementations§

Source§

impl Debug for CacheConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CacheConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CacheConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CacheConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more