MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / share

Method share

crates/opencode-session/src/session.rs:902–913  ·  view source on GitHub ↗

Set share info and publish session.updated.

(&mut self, session_id: &str, url: impl Into<String>)

Source from the content-addressed store, hash-verified

900
901 /// Set share info and publish session.updated.
902 pub fn share(&mut self, session_id: &str, url: impl Into<String>) -> Option<Session> {
903 let updated = {
904 let session = self.sessions.get_mut(session_id)?;
905 session.set_share(SessionShare { url: url.into() });
906 session.clone()
907 };
908 self.events.push(SessionEvent::Updated {
909 info: updated.clone(),
910 });
911 self.publish_session_event(&SESSION_UPDATED_EVENT, &updated);
912 Some(updated)
913 }
914
915 /// Clear share info and publish session.updated.
916 pub fn unshare(&mut self, session_id: &str) -> Option<Session> {

Callers 2

share_sessionFunction · 0.80

Calls 4

set_shareMethod · 0.80
publish_session_eventMethod · 0.80
get_mutMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected