pub struct RelayBuilder(/* private fields */);
Expand description
A builder for Pkarr Relay
Implementations§
Source§impl RelayBuilder
impl RelayBuilder
Sourcepub fn storage(&mut self, storage: PathBuf) -> &mut Self
pub fn storage(&mut self, storage: PathBuf) -> &mut Self
Set the storage directory.
This Relay’s cache will be stored in a subdirectory (pkarr-cache
) inside
that storage directory
Defaults to the path to the user’s data directory
Sourcepub fn cache_size(&mut self, size: usize) -> &mut Self
pub fn cache_size(&mut self, size: usize) -> &mut Self
See pkarr::ClientBuilder::cache_size
Defaults to 1_000_000
Sourcepub fn disable_rate_limiter(&mut self) -> &mut Self
pub fn disable_rate_limiter(&mut self) -> &mut Self
Disable the rate limiter.
Useful when running in a local test network.
Sourcepub fn rate_limiter_config(&mut self, config: RateLimiterConfig) -> &mut Self
pub fn rate_limiter_config(&mut self, config: RateLimiterConfig) -> &mut Self
Set the RateLimiterConfig.
Defaults to RateLimiterConfig::default.
Sourcepub fn pkarr<F>(&mut self, f: F) -> &mut Self
pub fn pkarr<F>(&mut self, f: F) -> &mut Self
Allows mutating the internal pkarr::ClientBuilder with a callback function.
Auto Trait Implementations§
impl Freeze for RelayBuilder
impl !RefUnwindSafe for RelayBuilder
impl Send for RelayBuilder
impl Sync for RelayBuilder
impl Unpin for RelayBuilder
impl !UnwindSafe for RelayBuilder
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