pub struct Document {
pub buf: Buffer,
pub indent: Indent,
pub source: DocumentSource,
}Fields§
§buf: Buffer§indent: IndentResolved at open/reload (config default or content-detected).
source: DocumentSourceWhat backs this document (0021 §4): the surface payload lives in the source variant; readonly derives from it at construction.
Implementations§
Source§impl Document
impl Document
pub fn remote(buffer: Buffer, source: RemoteDocument) -> Self
pub fn directory(buffer: Buffer, source: RemoteDirectory) -> Self
pub fn remote_metadata(&self) -> Option<&RemoteDocument>
pub fn directory_metadata_ref(&self) -> Option<&RemoteDirectory>
Source§impl Document
impl Document
pub fn new(buf: Buffer) -> Self
Sourcepub fn surface(buf: Buffer, surface: Surface, context: GitContext) -> Self
pub fn surface(buf: Buffer, surface: Surface, context: GitContext) -> Self
A git-memory surface: job-owned content, readonly derived from the source — not set by hand (0021 §4).
Sourcepub fn output(buf: Buffer) -> Self
pub fn output(buf: Buffer) -> Self
Named virtual content (:!cmd output, help, the undo browser):
readonly derived from the source.
Sourcepub fn container_file(
buf: Buffer,
container: ContainerId,
path: PathBuf,
) -> Self
pub fn container_file( buf: Buffer, container: ContainerId, path: PathBuf, ) -> Self
A file read from a container (0037 DC1a/b): readonly derived from the source; the path names container bytes, never a local file.
Sourcepub fn syntax_path(&self) -> Option<&Path>
pub fn syntax_path(&self) -> Option<&Path>
Syntax identity is data; parsers live on the display-analysis worker.
pub fn matches_target(&self, target: &FileTarget) -> bool
Sourcepub fn surface_payload(&self) -> Option<&Surface>
pub fn surface_payload(&self) -> Option<&Surface>
The surface payload, when this document is one.
Sourcepub fn surface_payload_mut(&mut self) -> Option<&mut Surface>
pub fn surface_payload_mut(&mut self) -> Option<&mut Surface>
Mutable surface payload, when this document is one.
Auto Trait Implementations§
impl !Freeze for Document
impl !RefUnwindSafe for Document
impl !Sync for Document
impl !UnwindSafe for Document
impl Send for Document
impl Unpin for Document
impl UnsafeUnpin for Document
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