pub struct RepoContext {
pub root: PathBuf,
pub git_paw_dir: Option<PathBuf>,
pub broker_url: Option<String>,
pub server_name: String,
}Expand description
Resolved context for a single git paw mcp invocation, constructed once
at startup and shared (read-only) by every tool.
Fields§
§root: PathBufAbsolute repository root (a worktree root resolves to its own root,
not the main repository — see resolve_repo).
git_paw_dir: Option<PathBuf><root>/.git-paw/ when it exists, else None (cold / pure-manual
repo).
broker_url: Option<String>Broker base URL (http://host:port) derived from the active session
receipt, or None when no session is active. Liveness is not
probed here — query helpers attempt the HTTP call and degrade to
empty results on failure.
server_name: StringEffective server identity advertised in the initialize handshake’s
serverInfo.name. Resolved once at construction from the loaded
config’s [mcp].name (defaulting to "git-paw") so the server handler
never re-loads config per get_info() call.
Implementations§
Source§impl RepoContext
impl RepoContext
Sourcepub fn for_root(root: PathBuf) -> Self
pub fn for_root(root: PathBuf) -> Self
Builds a RepoContext from a resolved repository root.
Reads the active session receipt (if any) to populate
RepoContext::broker_url; a missing or stopped session simply
leaves it None. Resolves the advertised server identity from the
merged config’s [mcp].name, defaulting to "git-paw" when unset (or
when the config cannot be loaded).
Trait Implementations§
Source§impl Clone for RepoContext
impl Clone for RepoContext
Source§fn clone(&self) -> RepoContext
fn clone(&self) -> RepoContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RepoContext
impl RefUnwindSafe for RepoContext
impl Send for RepoContext
impl Sync for RepoContext
impl Unpin for RepoContext
impl UnsafeUnpin for RepoContext
impl UnwindSafe for RepoContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more