pub struct Servo<Window: WindowMethods + 'static + ?Sized> {
pub(crate) compositor: IOCompositor<Window>,
pub(crate) constellation_chan: Sender<ConstellationMsg>,
pub(crate) embedder_receiver: EmbedderReceiver,
pub(crate) messages_for_embedder: Vec<(Option<TopLevelBrowsingContextId>, EmbedderMsg)>,
pub(crate) profiler_enabled: bool,
pub(crate) _js_engine_setup: Option<JSEngineSetup>,
}
Expand description
The in-process interface to Servo.
It does everything necessary to render the web, primarily orchestrating the interaction between JavaScript, CSS layout, rendering, and the client window.
Clients create a Servo
instance for a given reference-counted type
implementing WindowMethods
, which is the bridge to whatever
application Servo is embedded in. Clients then create an event
loop to pump messages between the embedding application and
various browser components.
Fields§
§compositor: IOCompositor<Window>
§constellation_chan: Sender<ConstellationMsg>
§embedder_receiver: EmbedderReceiver
§messages_for_embedder: Vec<(Option<TopLevelBrowsingContextId>, EmbedderMsg)>
§profiler_enabled: bool
§_js_engine_setup: Option<JSEngineSetup>
For single-process Servo instances, this field controls the initialization and deinitialization of the JS Engine. Multiprocess Servo instances have their own instance that exists in the content process instead.
Implementations§
source§impl<Window> Servo<Window>where
Window: WindowMethods + 'static + ?Sized,
impl<Window> Servo<Window>where
Window: WindowMethods + 'static + ?Sized,
pub fn new( embedder: Box<dyn EmbedderMethods>, window: Rc<Window>, user_agent: Option<String>, composite_target: CompositeTarget, ) -> InitializedServo<Window>
pub(crate) fn get_native_media_display_and_gl_context( rendering_context: &RenderingContext, ) -> Option<(NativeDisplay, GlContext)>
pub(crate) fn create_media_window_gl_context( external_image_handlers: &mut WebrenderExternalImageHandlers, external_images: Arc<Mutex<WebrenderExternalImageRegistry>>, rendering_context: &RenderingContext, ) -> (WindowGLContext, Option<GLPlayerThreads>)
pub(crate) fn handle_window_event(&mut self, event: EmbedderEvent) -> bool
pub(crate) fn send_to_constellation(&self, msg: ConstellationMsg)
pub(crate) fn receive_messages(&mut self)
pub fn get_events( &mut self, ) -> Drain<'_, (Option<TopLevelBrowsingContextId>, EmbedderMsg)>
pub fn handle_events( &mut self, events: impl IntoIterator<Item = EmbedderEvent>, ) -> bool
pub fn repaint_synchronously(&mut self)
pub fn pinch_zoom_level(&self) -> f32
pub fn setup_logging(&self)
pub fn window(&self) -> &Window
pub fn deinit(self)
pub fn present(&mut self)
sourcepub fn offscreen_framebuffer_id(&self) -> Option<u32>
pub fn offscreen_framebuffer_id(&self) -> Option<u32>
Return the OpenGL framebuffer name of the most-recently-completed frame when compositing to
CompositeTarget::Fbo
, or None otherwise.
Auto Trait Implementations§
impl<Window> !Freeze for Servo<Window>
impl<Window> !RefUnwindSafe for Servo<Window>
impl<Window> !Send for Servo<Window>
impl<Window> !Sync for Servo<Window>
impl<Window> Unpin for Servo<Window>where
Window: ?Sized,
impl<Window> !UnwindSafe for Servo<Window>
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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more