pub struct TrustConfig {
pub owners: Vec<String>,
pub packs: Vec<PackAllow>,
pub endpoints: Vec<EndpointAllow>,
}Expand description
The whole trust file.
Fields§
§owners: Vec<String>Remote owners (host/owner, e.g. github.com/scbrown) whose packs autoload.
packs: Vec<PackAllow>Foreign packs admitted one exact archive at a time.
endpoints: Vec<EndpointAllow>Foreign pointer endpoints admitted one exact URL at a time.
Implementations§
Source§impl TrustConfig
impl TrustConfig
Sourcepub fn load(path: &Path) -> Result<TrustConfig>
pub fn load(path: &Path) -> Result<TrustConfig>
Read and validate. A missing file trusts nothing. An invalid one refuses everything: a trust file that cannot be read is not permission.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Atomic write with read-back, like the stack config.
Sourcepub fn decide_pack(
&self,
remote: &str,
pack: &str,
pack_sha256: &str,
) -> Decision
pub fn decide_pack( &self, remote: &str, pack: &str, pack_sha256: &str, ) -> Decision
May the pack archive with this sha256, shipped by the repository at remote, load?
Sourcepub fn decide_endpoint(&self, remote: &str, endpoint: &str) -> Decision
pub fn decide_endpoint(&self, remote: &str, endpoint: &str) -> Decision
May a pointer endpoint declared by the pack of the repository at remote be federated?
Trait Implementations§
Source§impl Clone for TrustConfig
impl Clone for TrustConfig
Source§impl Debug for TrustConfig
impl Debug for TrustConfig
Source§impl Default for TrustConfig
impl Default for TrustConfig
Source§impl<'de> Deserialize<'de> for TrustConfig
impl<'de> Deserialize<'de> for TrustConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TrustConfig
Source§impl PartialEq for TrustConfig
impl PartialEq for TrustConfig
Source§impl Serialize for TrustConfig
impl Serialize for TrustConfig
impl StructuralPartialEq for TrustConfig
Auto Trait Implementations§
impl Forget for TrustConfig
impl Freeze for TrustConfig
impl Move for TrustConfig
impl RefUnwindSafe for TrustConfig
impl Send for TrustConfig
impl Sync for TrustConfig
impl Unpin for TrustConfig
impl UnsafeUnpin for TrustConfig
impl UnwindSafe for TrustConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.