pub struct CustomDocumentStateDTO {
pub URI: Url,
pub ViewType: String,
pub SideCarIdentifier: String,
pub IsEditable: bool,
pub BackupIdentifier: Option<String>,
pub Edits: HashMap<u32, Value>,
}Expand description
A struct that holds the state for a document being handled by a custom
editor. This is stored in ApplicationState to track the lifecycle of
custom documents.
Fields§
§URI: UrlThe URI of the document resource being edited.
ViewType: StringThe view type of the custom editor responsible for this document.
SideCarIdentifier: StringThe identifier of the sidecar process where the custom editor provider lives.
IsEditable: boolA flag indicating if the document is currently editable by the user.
BackupIdentifier: Option<String>An optional identifier for a backup copy of the file’s content.
Edits: HashMap<u32, Value>A map to store edit history or other versioning information. In a real implementation, this might hold a more structured edit type.
Implementations§
Source§impl CustomDocumentStateDTO
impl CustomDocumentStateDTO
Sourcepub fn New(
URI: Url,
ViewType: String,
SideCarIdentifier: String,
IsEditable: bool,
) -> Result<Self, String>
pub fn New( URI: Url, ViewType: String, SideCarIdentifier: String, IsEditable: bool, ) -> Result<Self, String>
Creates a new CustomDocumentStateDTO with validation.
§Arguments
URI- The document resource URIViewType- The custom editor type identifierSideCarIdentifier- The sidecar process identifierIsEditable- Whether the document is user-editable
§Returns
Result containing the DTO or an error if validation fails
Sourcepub fn ClearEdits(&mut self)
pub fn ClearEdits(&mut self)
Clears all edit history for this document.
Sourcepub fn GetEditCount(&self) -> usize
pub fn GetEditCount(&self) -> usize
Returns the count of edits tracked for this document.
Trait Implementations§
Source§impl Clone for CustomDocumentStateDTO
impl Clone for CustomDocumentStateDTO
Source§fn clone(&self) -> CustomDocumentStateDTO
fn clone(&self) -> CustomDocumentStateDTO
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomDocumentStateDTO
impl Debug for CustomDocumentStateDTO
Source§impl<'de> Deserialize<'de> for CustomDocumentStateDTO
impl<'de> Deserialize<'de> for CustomDocumentStateDTO
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CustomDocumentStateDTO
impl RefUnwindSafe for CustomDocumentStateDTO
impl Send for CustomDocumentStateDTO
impl Sync for CustomDocumentStateDTO
impl Unpin for CustomDocumentStateDTO
impl UnsafeUnpin for CustomDocumentStateDTO
impl UnwindSafe for CustomDocumentStateDTO
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].