pub struct AnnounceCache { /* private fields */ }Expand description
Announce cache backed by filesystem.
Implementations§
Source§impl AnnounceCache
impl AnnounceCache
Sourcepub fn new(base_path: PathBuf) -> Self
pub fn new(base_path: PathBuf) -> Self
Create an announce cache at the given directory.
The directory must already exist (created by ensure_storage_dirs).
Sourcepub fn store(
&self,
packet_hash: &[u8; 32],
raw: &[u8],
interface_name: Option<&str>,
) -> Result<()>
pub fn store( &self, packet_hash: &[u8; 32], raw: &[u8], interface_name: Option<&str>, ) -> Result<()>
Store a cached announce to disk.
packet_hash: 32-byte packet hash (used as filename)
raw: raw announce bytes (pre-hop-increment)
interface_name: optional interface name string
Auto Trait Implementations§
impl Freeze for AnnounceCache
impl RefUnwindSafe for AnnounceCache
impl Send for AnnounceCache
impl Sync for AnnounceCache
impl Unpin for AnnounceCache
impl UnwindSafe for AnnounceCache
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