pub struct FerroView { /* private fields */ }Expand description
Shows content in an element of the web page.
Implementations§
Source§impl FerroView
impl FerroView
Sourcepub fn new(div_id: &str) -> Rc<Self>
pub fn new(div_id: &str) -> Rc<Self>
Creates a view over the element with the given id.
div_id is the ID of the html element where the content should be
rendered.
§Panics
Panics when the document has no such element.
Sourcepub fn with_host(host: JsObject) -> Rc<Self>
pub fn with_host(host: JsObject) -> Rc<Self>
Creates a view over an element.
host is the object holding a div element where the content should
be rendered.
§Panics
Panics when host is null or undefined.
Sourcepub fn content(&self) -> Option<Ref<Control>>
pub fn content(&self) -> Option<Ref<Control>>
The content of the view.
§Panics
Panics when the content of the top-level was set to something that is not a control.
Sourcepub fn set_content(&self, value: Option<Ref<Control>>)
pub fn set_content(&self, value: Option<Ref<Control>>)
Sets the content of the view.
Sourcepub fn dispose(&self)
pub fn dispose(&self)
Closes the view: its top-level is disposed, which releases the surface of the canvas (on the thread that renders, the render target of the canvas and what drew to it) and stops the renderer of the view. The elements of the view stay in the page. The view cannot be used afterwards.
Not from upstream, whose view has no way to be closed (the top-level under it is disposable there as here). A page that shows and removes views would otherwise keep the canvas and the graphics context of every view it ever had.
Auto Trait Implementations§
impl !RefUnwindSafe for FerroView
impl !Send for FerroView
impl !Sync for FerroView
impl !UnwindSafe for FerroView
impl Freeze for FerroView
impl Unpin for FerroView
impl UnsafeUnpin for FerroView
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more