pub struct KeyStore {
pub magic: [u8; 4],
pub version: u8,
pub entries: Vec<KeyEntry>,
}Expand description
A teljes kulcstár
Fields§
§magic: [u8; 4]§version: u8§entries: Vec<KeyEntry>Implementations§
Source§impl KeyStore
impl KeyStore
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
Betölti a kulcstárat a megadott útvonalról. Ha a fájl nem létezik, üres kulcstárat ad vissza.
Sourcepub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Box<dyn Error>>
pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Box<dyn Error>>
Mentés bincode formátumban
Sourcepub fn get(&self, service: &str) -> Option<&KeyEntry>
pub fn get(&self, service: &str) -> Option<&KeyEntry>
Kulcs lekérése service név alapján, priority szerint (legkisebb szám = legmagasabb priority)
Sourcepub fn get_all(&self, service: &str) -> Vec<&KeyEntry>
pub fn get_all(&self, service: &str) -> Vec<&KeyEntry>
Az összes nem letiltott kulcs lekérése egy service-hez, priority sorrendben
Sourcepub fn set(&mut self, service: &str, key: String, priority: u8)
pub fn set(&mut self, service: &str, key: String, priority: u8)
Kulcs beállítása (hozzáadás vagy frissítés)
Sourcepub fn record_error(&mut self, service: &str, priority: u8, error: &str)
pub fn record_error(&mut self, service: &str, priority: u8, error: &str)
Hiba bejegyzése egy kulcshoz — ha quota hiba, letiltja
Sourcepub fn record_success(&mut self, service: &str, priority: u8)
pub fn record_success(&mut self, service: &str, priority: u8)
Sikeres hívás után: töröljük a hibát, opcionálisan frissítjük a quota-t
Sourcepub fn list(&self) -> Vec<KeyEntryInfo>
pub fn list(&self) -> Vec<KeyEntryInfo>
Kulcsok listázása (key nélkül, csak metaadatok)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyStore
impl<'de> Deserialize<'de> for KeyStore
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
Auto Trait Implementations§
impl Freeze for KeyStore
impl RefUnwindSafe for KeyStore
impl Send for KeyStore
impl Sync for KeyStore
impl Unpin for KeyStore
impl UnsafeUnpin for KeyStore
impl UnwindSafe for KeyStore
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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