pub struct WebviewStateDTO {
pub Handle: String,
pub ViewType: String,
pub Title: String,
pub ContentOptions: WebviewContentOptionsDTO,
pub PanelOptions: Value,
pub SideCarIdentifier: String,
pub ExtensionIdentifier: String,
pub IsActive: bool,
pub IsVisible: bool,
}Expand description
A struct that holds the complete state for a single Webview panel instance.
This is stored in ApplicationState to track all active Webviews managed by
the host.
Fields§
§Handle: StringA unique UUID handle for this Webview instance.
ViewType: StringThe view type of this Webview panel, as defined by the extension.
Title: StringThe current title of the Webview panel.
ContentOptions: WebviewContentOptionsDTOThe content and security options for the Webview’s content.
PanelOptions: ValueThe options controlling the behavior of the Webview panel itself.
SideCarIdentifier: StringThe identifier of the sidecar process that owns this Webview.
ExtensionIdentifier: StringThe identifier of the extension that owns this Webview.
IsActive: boolA flag indicating if the Webview panel currently has focus.
IsVisible: boolA flag indicating if the Webview panel is currently visible in the UI.
Implementations§
Source§impl WebviewStateDTO
impl WebviewStateDTO
Sourcepub fn New(
Handle: String,
ViewType: String,
Title: String,
ContentOptions: WebviewContentOptionsDTO,
PanelOptions: Value,
SideCarIdentifier: String,
ExtensionIdentifier: String,
) -> Result<Self, String>
pub fn New( Handle: String, ViewType: String, Title: String, ContentOptions: WebviewContentOptionsDTO, PanelOptions: Value, SideCarIdentifier: String, ExtensionIdentifier: String, ) -> Result<Self, String>
Creates a new WebviewStateDTO with validation.
§Arguments
Handle- Unique Webview handleViewType- Extension-defined view typeTitle- Panel titleContentOptions- Web content optionsPanelOptions- Panel behavior optionsSideCarIdentifier- Sidecar process IDExtensionIdentifier- Extension ID
§Returns
Result containing the DTO or validation error
Sourcepub fn SetVisibility(&mut self, IsVisible: bool)
pub fn SetVisibility(&mut self, IsVisible: bool)
Sourcepub fn IsDisplayed(&self) -> bool
pub fn IsDisplayed(&self) -> bool
Checks if the Webview is currently displayed (visible and focused).
Trait Implementations§
Source§impl Clone for WebviewStateDTO
impl Clone for WebviewStateDTO
Source§fn clone(&self) -> WebviewStateDTO
fn clone(&self) -> WebviewStateDTO
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebviewStateDTO
impl Debug for WebviewStateDTO
Source§impl<'de> Deserialize<'de> for WebviewStateDTO
impl<'de> Deserialize<'de> for WebviewStateDTO
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 WebviewStateDTO
impl RefUnwindSafe for WebviewStateDTO
impl Send for WebviewStateDTO
impl Sync for WebviewStateDTO
impl Unpin for WebviewStateDTO
impl UnsafeUnpin for WebviewStateDTO
impl UnwindSafe for WebviewStateDTO
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].