Struct scylla_proxy::Proxy
source · pub struct Proxy { /* private fields */ }
Implementations§
source§impl Proxy
impl Proxy
pub fn new(nodes: impl IntoIterator<Item = Node>) -> Self
pub fn builder() -> ProxyBuilder
sourcepub fn translation_map(&self) -> HashMap<SocketAddr, SocketAddr>
pub fn translation_map(&self) -> HashMap<SocketAddr, SocketAddr>
Build a translation map based on provided proxy and node addresses.
The map can be passed to Session
address_translator()
to ensure
that the driver contacts the nodes through the proxy (and not directly).
sourcepub async fn run(self) -> Result<RunningProxy, DoorkeeperError>
pub async fn run(self) -> Result<RunningProxy, DoorkeeperError>
Runs the Proxy, i.e. makes it ready for accepting drivers’ connections. Returns a RunningProxy handle that can be used to stop the proxy or change the rules.
Auto Trait Implementations§
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnwindSafe for Proxy
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