/// Updates the topology's logical session timeout value based on the server's value for it.
Updates the topology's logical session timeout value based on the server's value for it.
Updates the topology ' s logical session timeout value based on the server ' s value for it .
fn update_session_support_status(&mut self, server_description: &ServerDescription) {
        if !server_description.server_type.is_data_bearing() {
            if let TopologyType::Single = self.topology_type {
                self.session_support_status = SessionSupportStatus::Unsupported {
                    logical_session_timeout: None,
                };
            }
            return;
        }
        match server_description.logical_session_timeout().ok().flatten() {
            Some(timeout) => match self.session_support_status {
                SessionSupportStatus::Supported {
                    logical_session_timeout: topology_timeout,
                } => {
                    self.session_support_status = SessionSupportStatus::Supported {
                        logical_session_timeout: std::cmp::min(Some(timeout), topology_timeout),
                    };
                }
                SessionSupportStatus::Undetermined => {
                    self.session_support_status = SessionSupportStatus::Supported {
                        logical_session_timeout: Some(timeout),
                    }
                }
                SessionSupportStatus::Unsupported { .. } => {
                    // Check if the timeout is now reported on all servers, and, if so, assign the
                    // topology's timeout to the minimum.
                    let min_timeout = self
                        .servers
                        .values()
                        .filter(|s| s.server_type.is_data_bearing())
                        .map(|s| s.logical_session_timeout().ok().flatten())
                        .min()
                        .flatten();
                    match min_timeout {
                        Some(timeout) => {
                            self.session_support_status = SessionSupportStatus::Supported {
                                logical_session_timeout: Some(timeout),
                            }
                        }
                        None => {
                            self.session_support_status = SessionSupportStatus::Unsupported {
                                logical_session_timeout: None,
                            }
                        }
                    }
                }
            },
            None if server_description.server_type.is_data_bearing()
                || self.topology_type == TopologyType::Single =>
            {
                self.session_support_status = SessionSupportStatus::Unsupported {
                    logical_session_timeout: None,
                }
            }
            None => {}
        }
    }
fn update_session_support_status ( & mut self , server_description : & ServerDescription ) { if ! server_description . server_type . is_data_bearing ( ) { if let TopologyType :: Single = self . topology_type { self . session_support_status = SessionSupportStatus :: Unsupported { logical_session_timeout : None , } ; } return ; } match server_description . logical_session_timeout ( ) . ok ( ) . flatten ( ) { Some ( timeout ) => match self . session_support_status { SessionSupportStatus :: Supported { logical_session_timeout : topology_timeout , } => { self . session_support_status = SessionSupportStatus :: Supported { logical_session_timeout : std :: cmp :: min ( Some ( timeout ) , topology_timeout ) , } ; } SessionSupportStatus :: Undetermined => { self . session_support_status = SessionSupportStatus :: Supported { logical_session_timeout : Some ( timeout ) , } } SessionSupportStatus :: Unsupported { .. } => { // Check if the timeout is now reported on all servers, and, if so, assign the // topology's timeout to the minimum. let min_timeout = self . servers . values ( ) . filter ( | s | s . server_type . is_data_bearing ( ) ) . map ( | s | s . logical_session_timeout ( ) . ok ( ) . flatten ( ) ) . min ( ) . flatten ( ) ; match min_timeout { Some ( timeout ) => { self . session_support_status = SessionSupportStatus :: Supported { logical_session_timeout : Some ( timeout ) , } } None => { self . session_support_status = SessionSupportStatus :: Unsupported { logical_session_timeout : None , } } } } } , None if server_description . server_type . is_data_bearing ( ) || self . topology_type == TopologyType :: Single => { self . session_support_status = SessionSupportStatus :: Unsupported { logical_session_timeout : None , } } None => { } } }
Updates the topology's logical session timeout value based on the server's value for it.
Updates the topology ' s logical session timeout value based on the server ' s value for it .
&mut self
server_description
&ServerDescription