pub struct Session { /* private fields */ }Expand description
One reusable daemon connection. Not Sync: give each thread its own
Session (the connection carries one in-flight request at a time).
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(socket_path: impl Into<PathBuf>) -> Self
pub fn new(socket_path: impl Into<PathBuf>) -> Self
A session dialing socket_path (relative paths resolve against the CWD).
Sourcepub fn default_socket() -> Self
pub fn default_socket() -> Self
A session dialing the default socket ($<prefix>SESSION_SOCK or the
per-repo default).
Sourcepub fn files(&mut self, request: &SearchRequest) -> Result<Vec<String>>
pub fn files(&mut self, request: &SearchRequest) -> Result<Vec<String>>
Files with ≥1 matching line (-l), sorted — warm if the daemon serves
it, else the byte-identical cold answer.
§Errors
Only the cold path errors (see SearchRequest::files); a warm miss
silently falls back rather than surfacing a transport error.
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
Mutably borrows from an owned value. Read more