pub struct ScriptThread {Show 42 fields
last_render_opportunity_time: DomRefCell<Option<Instant>>,
documents: DomRefCell<DocumentCollection>,
window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>,
incomplete_loads: DomRefCell<Vec<InProgressLoad>>,
incomplete_parser_contexts: IncompleteParserContexts,
image_cache: Arc<dyn ImageCache>,
receivers: ScriptThreadReceivers,
senders: ScriptThreadSenders,
resource_threads: ResourceThreads,
task_queue: TaskQueue<MainThreadScriptMsg>,
background_hang_monitor: Box<dyn BackgroundHangMonitor>,
closing: Arc<AtomicBool>,
timer_scheduler: RefCell<TimerScheduler>,
system_font_service: Arc<SystemFontServiceProxy>,
js_runtime: Rc<Runtime>,
topmost_mouse_over_target: MutNullableDom<Element>,
closed_pipelines: DomRefCell<HashSet<PipelineId>>,
microtask_queue: Rc<MicrotaskQueue>,
mutation_observer_microtask_queued: Cell<bool>,
mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>,
signal_slots: DomRefCell<Vec<Dom<HTMLSlotElement>>>,
webgl_chan: Option<WebGLPipeline>,
webxr_registry: Option<Registry>,
worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>,
docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>,
custom_element_reaction_stack: CustomElementReactionStack,
webrender_document: DocumentId,
compositor_api: CrossProcessCompositorApi,
profile_script_events: bool,
print_pwm: bool,
relayout_event: bool,
unminify_js: bool,
local_script_source: Option<String>,
unminify_css: bool,
user_content_manager: UserContentManager,
user_agent: Cow<'static, str>,
player_context: WindowGLContext,
node_ids: DomRefCell<HashSet<String>>,
is_user_interacting: Cell<bool>,
gpu_id_hub: Arc<IdentityHub>,
inherited_secure_context: Option<bool>,
layout_factory: Arc<dyn LayoutFactory>,
}
Fields§
§last_render_opportunity_time: DomRefCell<Option<Instant>>
§documents: DomRefCell<DocumentCollection>
The documents for pipelines managed by this thread
window_proxies: DomRefCell<HashMapTracedValues<BrowsingContextId, Dom<WindowProxy>>>
The window proxies known by this thread TODO: this map grows, but never shrinks. Issue #15258.
incomplete_loads: DomRefCell<Vec<InProgressLoad>>
A list of data pertaining to loads that have not yet received a network response
incomplete_parser_contexts: IncompleteParserContexts
A vector containing parser contexts which have not yet been fully processed
image_cache: Arc<dyn ImageCache>
Image cache for this script thread.
receivers: ScriptThreadReceivers
A ScriptThreadReceivers
holding all of the incoming Receiver
s for messages
to this ScriptThread
.
senders: ScriptThreadSenders
A ScriptThreadSenders
that holds all outgoing sending channels necessary to communicate
to other parts of Servo.
resource_threads: ResourceThreads
A handle to the resource thread. This is an Arc
to avoid running out of file descriptors if
there are many iframes.
task_queue: TaskQueue<MainThreadScriptMsg>
A queue of tasks to be executed in this script-thread.
background_hang_monitor: Box<dyn BackgroundHangMonitor>
The dedicated means of communication with the background-hang-monitor for this script-thread.
closing: Arc<AtomicBool>
A flag set to true
by the BHM on exit, and checked from within the interrupt handler.
timer_scheduler: RefCell<TimerScheduler>
A TimerScheduler
used to schedule timers for this ScriptThread
. Timers are handled
in the ScriptThread
event loop.
system_font_service: Arc<SystemFontServiceProxy>
A proxy to the SystemFontService
to use for accessing system font lists.
js_runtime: Rc<Runtime>
The JavaScript runtime.
topmost_mouse_over_target: MutNullableDom<Element>
The topmost element over the mouse.
closed_pipelines: DomRefCell<HashSet<PipelineId>>
List of pipelines that have been owned and closed by this script thread.
microtask_queue: Rc<MicrotaskQueue>
§mutation_observer_microtask_queued: Cell<bool>
Microtask Queue for adding support for mutation observer microtasks
mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>
The unit of related similar-origin browsing contexts’ list of MutationObserver objects
signal_slots: DomRefCell<Vec<Dom<HTMLSlotElement>>>
§webgl_chan: Option<WebGLPipeline>
A handle to the WebGL thread
webxr_registry: Option<Registry>
The WebXR device registry
worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>
The worklet thread pool
docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>
A list of pipelines containing documents that finished loading all their blocking resources during a turn of the event loop.
custom_element_reaction_stack: CustomElementReactionStack
§webrender_document: DocumentId
The Webrender Document ID associated with this thread.
compositor_api: CrossProcessCompositorApi
Cross-process access to the compositor’s API.
profile_script_events: bool
Periodically print out on which events script threads spend their processing time.
print_pwm: bool
Print Progressive Web Metrics to console.
relayout_event: bool
Emits notifications when there is a relayout.
unminify_js: bool
Unminify Javascript.
local_script_source: Option<String>
Directory with stored unminified scripts
unminify_css: bool
Unminify Css.
user_content_manager: UserContentManager
User content manager
user_agent: Cow<'static, str>
An optional string allowing the user agent to be set for testing.
player_context: WindowGLContext
Application window’s GL Context for Media player
node_ids: DomRefCell<HashSet<String>>
A set of all nodes ever created in this script thread
is_user_interacting: Cell<bool>
Code is running as a consequence of a user interaction
gpu_id_hub: Arc<IdentityHub>
Identity manager for WebGPU resources
inherited_secure_context: Option<bool>
§layout_factory: Arc<dyn LayoutFactory>
A factory for making new layouts. This allows layout to depend on script.
Implementations§
Source§impl ScriptThread
impl ScriptThread
pub(crate) fn runtime_handle() -> ParentRuntime
pub(crate) fn can_continue_running() -> bool
pub(crate) fn prepare_for_shutdown()
pub(crate) fn set_mutation_observer_microtask_queued(value: bool)
pub(crate) fn is_mutation_observer_microtask_queued() -> bool
pub(crate) fn add_mutation_observer(observer: &MutationObserver)
pub(crate) fn get_mutation_observers() -> Vec<DomRoot<MutationObserver>>
pub(crate) fn add_signal_slot(observer: &HTMLSlotElement)
pub(crate) fn take_signal_slots() -> Vec<DomRoot<HTMLSlotElement>>
pub(crate) fn mark_document_with_no_blocked_loads(doc: &Document)
pub(crate) fn page_headers_available( id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<DomRoot<ServoParser>>
Sourcepub(crate) fn process_event(msg: CommonScriptMsg) -> bool
pub(crate) fn process_event(msg: CommonScriptMsg) -> bool
Process a single event as if it were the next event in the queue for this window event-loop. Returns a boolean indicating whether further events should be processed.
Sourcepub(crate) fn schedule_timer(&self, request: TimerEventRequest)
pub(crate) fn schedule_timer(&self, request: TimerEventRequest)
Schedule a TimerEventRequest
on this ScriptThread
’s TimerScheduler
.
pub(crate) fn await_stable_state(task: Microtask)
Sourcepub(crate) fn check_load_origin(
source: &LoadOrigin,
target: &ImmutableOrigin,
) -> bool
pub(crate) fn check_load_origin( source: &LoadOrigin, target: &ImmutableOrigin, ) -> bool
Check that two origins are “similar enough”, for now only used to prevent cross-origin JS url evaluation.
pub(crate) fn process_attach_layout( new_layout_info: NewLayoutInfo, origin: MutableOrigin, )
pub(crate) fn get_top_level_for_browsing_context( sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<WebViewId>
pub(crate) fn find_document(id: PipelineId) -> Option<DomRoot<Document>>
pub(crate) fn set_user_interacting(interacting: bool)
pub(crate) fn is_user_interacting() -> bool
pub(crate) fn get_fully_active_document_ids() -> HashSet<PipelineId>
pub(crate) fn find_window_proxy( id: BrowsingContextId, ) -> Option<DomRoot<WindowProxy>>
pub(crate) fn find_window_proxy_by_name( name: &DOMString, ) -> Option<DomRoot<WindowProxy>>
pub(crate) fn worklet_thread_pool() -> Rc<WorkletThreadPool>
fn handle_register_paint_worklet( &self, pipeline_id: PipelineId, name: Atom, properties: Vec<Atom>, painter: Box<dyn Painter>, )
pub(crate) fn push_new_element_queue()
pub(crate) fn pop_current_element_queue(can_gc: CanGc)
pub(crate) fn enqueue_callback_reaction( element: &Element, reaction: CallbackReaction, definition: Option<Rc<CustomElementDefinition>>, )
pub(crate) fn enqueue_upgrade_reaction( element: &Element, definition: Rc<CustomElementDefinition>, )
pub(crate) fn invoke_backup_element_queue(can_gc: CanGc)
pub(crate) fn save_node_id(node_id: String)
pub(crate) fn has_node_id(node_id: &str) -> bool
Sourcepub(crate) fn new(
state: InitialScriptState,
layout_factory: Arc<dyn LayoutFactory>,
system_font_service: Arc<SystemFontServiceProxy>,
user_agent: Cow<'static, str>,
) -> ScriptThread
pub(crate) fn new( state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, user_agent: Cow<'static, str>, ) -> ScriptThread
Creates a new script thread.
pub(crate) fn get_cx(&self) -> JSContext
Sourcefn can_continue_running_inner(&self) -> bool
fn can_continue_running_inner(&self) -> bool
Check if we are closing.
Sourcefn prepare_for_shutdown_inner(&self)
fn prepare_for_shutdown_inner(&self)
We are closing, ensure no script can run and potentially hang.
Sourcepub(crate) fn start(&self, can_gc: CanGc)
pub(crate) fn start(&self, can_gc: CanGc)
Starts the script thread. After calling this method, the script thread will loop receiving messages on its port.
Sourcefn process_mouse_move_event(
&self,
document: &Document,
hit_test_result: Option<CompositorHitTestResult>,
pressed_mouse_buttons: u16,
can_gc: CanGc,
)
fn process_mouse_move_event( &self, document: &Document, hit_test_result: Option<CompositorHitTestResult>, pressed_mouse_buttons: u16, can_gc: CanGc, )
Process a compositor mouse move event.
Sourcefn process_pending_input_events(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn process_pending_input_events(&self, pipeline_id: PipelineId, can_gc: CanGc)
Process compositor events as part of a “update the rendering task”.
Sourcepub(crate) fn update_the_rendering(
&self,
requested_by_compositor: bool,
can_gc: CanGc,
)
pub(crate) fn update_the_rendering( &self, requested_by_compositor: bool, can_gc: CanGc, )
https://html.spec.whatwg.org/multipage/#update-the-rendering
Attempt to update the rendering and then do a microtask checkpoint if rendering was actually updated.
fn schedule_rendering_opportunity_if_necessary(&self)
Sourcefn handle_msgs(&self, can_gc: CanGc) -> bool
fn handle_msgs(&self, can_gc: CanGc) -> bool
Handle incoming messages from other tasks and the task queue.
fn categorize_msg(&self, msg: &MixedMessage) -> ScriptThreadEventCategory
fn profile_event<F, R>(
&self,
category: ScriptThreadEventCategory,
pipeline_id: Option<PipelineId>,
f: F,
) -> Rwhere
F: FnOnce() -> R,
fn handle_msg_from_constellation(&self, msg: ScriptThreadMessage, can_gc: CanGc)
fn handle_set_scroll_states( &self, pipeline_id: PipelineId, scroll_states: Vec<ScrollState>, )
fn handle_msg_from_webgpu_server(&self, msg: WebGPUMsg, can_gc: CanGc)
fn handle_msg_from_script(&self, msg: MainThreadScriptMsg)
fn handle_msg_from_devtools(&self, msg: DevtoolScriptControlMsg, can_gc: CanGc)
fn handle_msg_from_image_cache(&self, response: PendingImageResponse)
fn handle_webdriver_msg( &self, pipeline_id: PipelineId, msg: WebDriverScriptCommand, can_gc: CanGc, )
Sourcepub(crate) fn handle_resize_message(
&self,
id: PipelineId,
size: WindowSizeData,
size_type: WindowSizeType,
)
pub(crate) fn handle_resize_message( &self, id: PipelineId, size: WindowSizeData, size_type: WindowSizeType, )
Batch window resize operations into a single “update the rendering” task, or, if a load is in progress, set the window size directly.
Sourcefn handle_theme_change_msg(&self, theme: Theme)
fn handle_theme_change_msg(&self, theme: Theme)
Handle changes to the theme, triggering reflow if the theme actually changed.
fn handle_exit_fullscreen(&self, id: PipelineId, can_gc: CanGc)
fn handle_viewport(&self, id: PipelineId, rect: Rect<f32>)
fn handle_new_layout( &self, new_layout_info: NewLayoutInfo, origin: MutableOrigin, )
fn collect_reports(&self, reports_chan: ReportsChan)
Sourcefn handle_set_throttled_in_containing_iframe_msg(
&self,
parent_pipeline_id: PipelineId,
browsing_context_id: BrowsingContextId,
throttled: bool,
)
fn handle_set_throttled_in_containing_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, throttled: bool, )
Updates iframe element after a change in visibility
fn handle_set_throttled_msg(&self, id: PipelineId, throttled: bool)
Sourcefn handle_set_document_activity_msg(
&self,
id: PipelineId,
activity: DocumentActivity,
can_gc: CanGc,
)
fn handle_set_document_activity_msg( &self, id: PipelineId, activity: DocumentActivity, can_gc: CanGc, )
Handles activity change message
fn handle_focus_iframe_msg( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, can_gc: CanGc, )
fn handle_post_message_msg( &self, pipeline_id: PipelineId, source_pipeline_id: PipelineId, source_browsing_context: WebViewId, origin: Option<ImmutableOrigin>, source_origin: ImmutableOrigin, data: StructuredSerializedData, )
fn handle_stop_delaying_load_events_mode(&self, pipeline_id: PipelineId)
fn handle_unload_document(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn handle_update_pipeline_id( &self, parent_pipeline_id: PipelineId, browsing_context_id: BrowsingContextId, webview_id: WebViewId, new_pipeline_id: PipelineId, reason: UpdatePipelineIdReason, can_gc: CanGc, )
fn handle_update_history_state_msg( &self, pipeline_id: PipelineId, history_state_id: Option<HistoryStateId>, url: ServoUrl, can_gc: CanGc, )
fn handle_remove_history_states( &self, pipeline_id: PipelineId, history_states: Vec<HistoryStateId>, )
Sourcefn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData)
fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData)
Window was resized, but this script was not active, so don’t reflow yet
Sourcefn handle_page_headers_available(
&self,
id: &PipelineId,
metadata: Option<Metadata>,
can_gc: CanGc,
) -> Option<DomRoot<ServoParser>>
fn handle_page_headers_available( &self, id: &PipelineId, metadata: Option<Metadata>, can_gc: CanGc, ) -> Option<DomRoot<ServoParser>>
We have received notification that the response associated with a load has completed. Kick off the document and frame tree creation process using the result.
Sourcefn handle_get_title_msg(&self, pipeline_id: PipelineId)
fn handle_get_title_msg(&self, pipeline_id: PipelineId)
Handles a request for the window title.
Sourcefn handle_exit_pipeline_msg(
&self,
id: PipelineId,
discard_bc: DiscardBrowsingContext,
can_gc: CanGc,
)
fn handle_exit_pipeline_msg( &self, id: PipelineId, discard_bc: DiscardBrowsingContext, can_gc: CanGc, )
Handles a request to exit a pipeline and shut down layout.
Sourcefn handle_exit_script_thread_msg(&self, can_gc: CanGc)
fn handle_exit_script_thread_msg(&self, can_gc: CanGc)
Handles a request to exit the script thread and shut down layout.
Sourcepub(crate) fn handle_tick_all_animations_for_testing(id: PipelineId)
pub(crate) fn handle_tick_all_animations_for_testing(id: PipelineId)
Handles animation tick requested during testing.
Sourcefn handle_web_font_loaded(&self, pipeline_id: PipelineId, _success: bool)
fn handle_web_font_loaded(&self, pipeline_id: PipelineId, _success: bool)
Handles a Web font being loaded. Does nothing if the page no longer exists.
Sourcefn handle_worklet_loaded(&self, pipeline_id: PipelineId)
fn handle_worklet_loaded(&self, pipeline_id: PipelineId)
Handles a worklet being loaded by triggering a relayout of the page. Does nothing if the page no longer exists.
Sourcefn handle_storage_event(
&self,
pipeline_id: PipelineId,
storage_type: StorageType,
url: ServoUrl,
key: Option<String>,
old_value: Option<String>,
new_value: Option<String>,
)
fn handle_storage_event( &self, pipeline_id: PipelineId, storage_type: StorageType, url: ServoUrl, key: Option<String>, old_value: Option<String>, new_value: Option<String>, )
Notify a window of a storage event
Sourcefn handle_iframe_load_event(
&self,
parent_id: PipelineId,
browsing_context_id: BrowsingContextId,
child_id: PipelineId,
can_gc: CanGc,
)
fn handle_iframe_load_event( &self, parent_id: PipelineId, browsing_context_id: BrowsingContextId, child_id: PipelineId, can_gc: CanGc, )
Notify the containing document of a child iframe that has completed loading.
fn ask_constellation_for_browsing_context_info( &self, pipeline_id: PipelineId, ) -> Option<(BrowsingContextId, Option<PipelineId>)>
fn ask_constellation_for_top_level_info( &self, sender_pipeline: PipelineId, browsing_context_id: BrowsingContextId, ) -> Option<WebViewId>
fn remote_window_proxy( &self, global_to_clone: &GlobalScope, webview_id: WebViewId, pipeline_id: PipelineId, opener: Option<BrowsingContextId>, ) -> Option<DomRoot<WindowProxy>>
fn local_window_proxy( &self, window: &Window, browsing_context_id: BrowsingContextId, webview_id: WebViewId, parent_info: Option<PipelineId>, opener: Option<BrowsingContextId>, ) -> DomRoot<WindowProxy>
Sourcefn load(
&self,
metadata: Metadata,
incomplete: InProgressLoad,
can_gc: CanGc,
) -> DomRoot<ServoParser>
fn load( &self, metadata: Metadata, incomplete: InProgressLoad, can_gc: CanGc, ) -> DomRoot<ServoParser>
The entry point to document loading. Defines bindings, sets up the window and document objects, parses HTML and CSS, and kicks off initial layout.
fn notify_devtools( &self, title: DOMString, url: ServoUrl, is_top_level_global: bool, (browsing_context_id, pipeline_id, worker_id, webview_id): (BrowsingContextId, PipelineId, Option<WorkerId>, WebViewId), )
Sourcefn handle_input_event(
&self,
pipeline_id: PipelineId,
event: ConstellationInputEvent,
)
fn handle_input_event( &self, pipeline_id: PipelineId, event: ConstellationInputEvent, )
Queue compositor events for later dispatching as part of a
update_the_rendering
task.
Handle a “navigate an iframe” message from the constellation.
Sourcepub(crate) fn eval_js_url(
global_scope: &GlobalScope,
load_data: &mut LoadData,
can_gc: CanGc,
)
pub(crate) fn eval_js_url( global_scope: &GlobalScope, load_data: &mut LoadData, can_gc: CanGc, )
Turn javascript: URL into JS code to eval, according to the steps in https://html.spec.whatwg.org/multipage/#javascript-protocol
Sourcefn pre_page_load(&self, incomplete: InProgressLoad)
fn pre_page_load(&self, incomplete: InProgressLoad)
Instructs the constellation to fetch the document that will be loaded. Stores the InProgressLoad argument until a notification is received that the fetch is complete.
fn handle_fetch_metadata( &self, id: PipelineId, request_id: RequestId, fetch_metadata: Result<FetchMetadata, NetworkError>, )
fn handle_fetch_chunk( &self, pipeline_id: PipelineId, request_id: RequestId, chunk: Vec<u8>, )
fn handle_fetch_eof( &self, id: PipelineId, request_id: RequestId, eof: Result<ResourceFetchTiming, NetworkError>, )
Sourcefn start_page_load_about_blank(&self, incomplete: InProgressLoad)
fn start_page_load_about_blank(&self, incomplete: InProgressLoad)
Synchronously fetch about:blank
. Stores the InProgressLoad
argument until a notification is received that the fetch is complete.
Sourcefn page_load_about_srcdoc(&self, incomplete: InProgressLoad)
fn page_load_about_srcdoc(&self, incomplete: InProgressLoad)
Synchronously parse a srcdoc document from a giving HTML string.
fn handle_css_error_reporting( &self, pipeline_id: PipelineId, filename: String, line: u32, column: u32, msg: String, )
fn handle_reload(&self, pipeline_id: PipelineId, can_gc: CanGc)
fn handle_paint_metric( &self, pipeline_id: PipelineId, metric_type: ProgressiveWebMetricType, metric_value: CrossProcessInstant, first_reflow: bool, can_gc: CanGc, )
fn handle_media_session_action( &self, pipeline_id: PipelineId, action: MediaSessionActionType, can_gc: CanGc, )
pub(crate) fn enqueue_microtask(job: Microtask)
fn perform_a_microtask_checkpoint(&self, can_gc: CanGc)
Trait Implementations§
Source§impl Drop for ScriptThread
impl Drop for ScriptThread
Source§impl ScriptThreadFactory for ScriptThread
impl ScriptThreadFactory for ScriptThread
Source§fn create(
state: InitialScriptState,
layout_factory: Arc<dyn LayoutFactory>,
system_font_service: Arc<SystemFontServiceProxy>,
load_data: LoadData,
user_agent: Cow<'static, str>,
)
fn create( state: InitialScriptState, layout_factory: Arc<dyn LayoutFactory>, system_font_service: Arc<SystemFontServiceProxy>, load_data: LoadData, user_agent: Cow<'static, str>, )
ScriptThread
.Auto Trait Implementations§
impl !Freeze for ScriptThread
impl !RefUnwindSafe for ScriptThread
impl !Send for ScriptThread
impl !Sync for ScriptThread
impl Unpin for ScriptThread
impl !UnwindSafe for ScriptThread
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