pub struct ManagedSnapshot {
pub handle: SnapshotHandle,
pub projects: Vec<ProjectResponse>,
pub changes: Option<SnapshotChanges>,
/* private fields */
}Expand description
Live snapshot handle with automatic release-on-drop semantics.
A managed snapshot bundles the opaque remote handle together with the
project list and optional change summary returned by updateSnapshot. When
the wrapper is dropped, it schedules a best-effort handle release so callers
do not leak server-side snapshot state accidentally.
Fields§
§handle: SnapshotHandleOpaque snapshot handle used by follow-up API requests.
projects: Vec<ProjectResponse>Projects visible inside the snapshot at creation time.
changes: Option<SnapshotChanges>Optional project-level delta information returned by tsgo.
Implementations§
Source§impl ManagedSnapshot
impl ManagedSnapshot
Sourcepub fn project(&self, config_file_name: &str) -> Option<&ProjectResponse>
pub fn project(&self, config_file_name: &str) -> Option<&ProjectResponse>
Looks up a project by its tsconfig path.
This is a convenience helper for the common “find the project that owns this config file” flow after snapshot creation.
Sourcepub async fn get_default_project_for_file(
&self,
file: impl Into<DocumentIdentifier>,
) -> Result<Option<ProjectResponse>, TsgoError>
pub async fn get_default_project_for_file( &self, file: impl Into<DocumentIdentifier>, ) -> Result<Option<ProjectResponse>, TsgoError>
Delegates to ApiClient::get_default_project_for_file using this snapshot.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ManagedSnapshot
impl !RefUnwindSafe for ManagedSnapshot
impl Send for ManagedSnapshot
impl Sync for ManagedSnapshot
impl Unpin for ManagedSnapshot
impl UnsafeUnpin for ManagedSnapshot
impl !UnwindSafe for ManagedSnapshot
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