[−][src]Struct mongodb_h2co3::topology::TopologyDescription
Topology information gathered from server set monitoring.
Fields
topology_type: TopologyType
set_name: String
The set name for a replica set topology. If the topology is not a replica set, this will be an empty string.
servers: HashMap<Host, Server>
Known servers within the topology.
heartbeat_frequency_ms: u32
The server connection health check frequency. The default is 10 seconds.
local_threshold_ms: i64
The size of the latency window for selecting suitable servers. The default is 15 milliseconds.
server_selection_timeout_ms: i64
This defines how long to block for server selection before returning an error. The default is 30 seconds.
Methods
impl TopologyDescription
[src]
impl TopologyDescription
pub fn new(stream_connector: StreamConnector) -> TopologyDescription
[src]
pub fn new(stream_connector: StreamConnector) -> TopologyDescription
Returns a default, unknown topology description.
pub fn acquire_stream(
&self,
client: Client,
read_preference: &ReadPreference
) -> Result<(PooledStream, bool, bool)>
[src]
pub fn acquire_stream(
&self,
client: Client,
read_preference: &ReadPreference
) -> Result<(PooledStream, bool, bool)>
Returns a server stream for read operations.
pub fn acquire_write_stream(&self, client: Client) -> Result<PooledStream>
[src]
pub fn acquire_write_stream(&self, client: Client) -> Result<PooledStream>
Returns a server stream for write operations.
pub fn filter_hosts(
&self,
hosts: &mut Vec<Host>,
read_preference: &ReadPreference
)
[src]
pub fn filter_hosts(
&self,
hosts: &mut Vec<Host>,
read_preference: &ReadPreference
)
Filters a given set of hosts based on the provided read preference tag sets.
pub fn filter_latency_hosts(&self, hosts: &mut Vec<Host>)
[src]
pub fn filter_latency_hosts(&self, hosts: &mut Vec<Host>)
Filter out provided hosts by creating a latency window around the server with the lowest round-trip time.
pub fn choose_write_hosts(&self) -> (Vec<Host>, bool)
[src]
pub fn choose_write_hosts(&self) -> (Vec<Host>, bool)
Returns suitable servers for write operations and whether to take a random element.
pub fn choose_hosts(
&self,
read_preference: &ReadPreference
) -> Result<(Vec<Host>, bool)>
[src]
pub fn choose_hosts(
&self,
read_preference: &ReadPreference
) -> Result<(Vec<Host>, bool)>
Returns suitable servers for read operations and whether to take a random element.
pub fn update_without_monitor(
&mut self,
host: Host,
description: Arc<RwLock<ServerDescription>>,
client: Client,
top_arc: Arc<RwLock<TopologyDescription>>
)
[src]
pub fn update_without_monitor(
&mut self,
host: Host,
description: Arc<RwLock<ServerDescription>>,
client: Client,
top_arc: Arc<RwLock<TopologyDescription>>
)
Update the topology description, but don't start any monitors for new servers.
pub fn update(
&mut self,
host: Host,
description: Arc<RwLock<ServerDescription>>,
client: Client,
top_arc: Arc<RwLock<TopologyDescription>>
)
[src]
pub fn update(
&mut self,
host: Host,
description: Arc<RwLock<ServerDescription>>,
client: Client,
top_arc: Arc<RwLock<TopologyDescription>>
)
Updates the topology description based on an updated server description.
Trait Implementations
impl Default for TopologyDescription
[src]
impl Default for TopologyDescription
impl Clone for TopologyDescription
[src]
impl Clone for TopologyDescription
fn clone(&self) -> TopologyDescription
[src]
fn clone(&self) -> TopologyDescription
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for TopologyDescription
[src]
impl Debug for TopologyDescription
Auto Trait Implementations
impl Send for TopologyDescription
impl Send for TopologyDescription
impl Sync for TopologyDescription
impl Sync for TopologyDescription
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
impl<T, U> TryInto for T where
U: TryFrom<T>,
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self