pub struct FigBackend { /* private fields */ }Expand description
A Backend over a standalone config file, backed by fig::Editor.
Implementations§
Source§impl FigBackend
impl FigBackend
Trait Implementations§
Source§impl Backend for FigBackend
impl Backend for FigBackend
Source§fn apply(&mut self, op: EditOp) -> Result<(), BackendError>
fn apply(&mut self, op: EditOp) -> Result<(), BackendError>
Apply one edit. Atomic: on
Err, the document is unchanged.Source§fn to_value(&self) -> Result<Value, BackendError>
fn to_value(&self) -> Result<Value, BackendError>
The current value tree to render (for an embed backend, the metadata
region — not the whole host file).
Source§fn source(&self) -> Result<String, BackendError>
fn source(&self) -> Result<String, BackendError>
The canonical serialized form the embedder persists on save (for an embed
backend, the full rendered host file).
Source§fn leading_comment(&self, path: &[Seg]) -> Result<Option<String>, BackendError>
fn leading_comment(&self, path: &[Seg]) -> Result<Option<String>, BackendError>
The own-line comment block immediately above the node at
path, lines
joined by \n with markers and indentation stripped. None when there is
no block — and, by default, always: a backend that never reads comments
renders every page exactly as it did before this method existed, so the
comment surface is opt-in for an implementor and never a blank column
for a document that has none. Read moreSource§fn trailing_comment(&self, path: &[Seg]) -> Result<Option<String>, BackendError>
fn trailing_comment(&self, path: &[Seg]) -> Result<Option<String>, BackendError>
The same-line comment after the value at
path, marker stripped. None
when there is none, and by default always — see
leading_comment.Source§fn schema(&self) -> Option<Schema>
fn schema(&self) -> Option<Schema>
The schema governing this document, if the backend knows one. The backend
is exactly the component that knows where the document came from, so it is
the right place to know what governs it — a prov backend returns the schema
resolved from the workspace config; a standalone config file has none.
Defaulted to
None so existing backends are unaffected.Source§fn candidates(&self, path: &[Seg]) -> Result<Option<Vec<Choice>>, BackendError>
fn candidates(&self, path: &[Seg]) -> Result<Option<Vec<Choice>>, BackendError>
The values a picker at
path should offer, when the backend can
enumerate them. None — the default — means it cannot, and a frontend
falls back to free text. Read moreAuto Trait Implementations§
impl !Send for FigBackend
impl !Sync for FigBackend
impl Freeze for FigBackend
impl RefUnwindSafe for FigBackend
impl Unpin for FigBackend
impl UnsafeUnpin for FigBackend
impl UnwindSafe for FigBackend
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