MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_session

Method write_session

nodedb/src/control/server/pgwire/session/store.rs:189–196  ·  view source on GitHub ↗

Access the session map with a write lock for use by other session submodules.

(
        &self,
        addr: &SocketAddr,
        f: impl FnOnce(&mut PgSession) -> R,
    )

Source from the content-addressed store, hash-verified

187
188 /// Access the session map with a write lock for use by other session submodules.
189 pub(super) fn write_session<R>(
190 &self,
191 addr: &SocketAddr,
192 f: impl FnOnce(&mut PgSession) -> R,
193 ) -> Option<R> {
194 let mut sessions = self.sessions.write().unwrap_or_else(|p| p.into_inner());
195 sessions.get_mut(addr).map(f)
196 }
197}

Callers 15

register_temp_tableMethod · 0.80
remove_temp_tableMethod · 0.80
prepare_sql_statementMethod · 0.80
set_parameterMethod · 0.80
add_live_subscriptionMethod · 0.80
push_noticeMethod · 0.80
drain_noticesMethod · 0.80
listen_channelMethod · 0.80
unlisten_channelMethod · 0.80

Calls 2

writeMethod · 0.45
get_mutMethod · 0.45

Tested by

no test coverage detected