Skip to main content

ProxyViewAssistant

Struct ProxyViewAssistant 

Source
pub struct ProxyViewAssistant { /* private fields */ }

Implementations§

Source§

impl ProxyViewAssistant

Source

pub fn new( event_sender: Option<Box<dyn SendEvent>>, console_view_assistant: Option<ViewAssistantPtr>, view_assistant_ptr: ViewAssistantPtr, ) -> Result<ProxyViewAssistant, Error>

Creates a new ProxyViewAssistant with the provided view assistants. Console is disabled if console_view_assistant is None.

Trait Implementations§

Source§

impl ViewAssistant for ProxyViewAssistant

Source§

fn setup(&mut self, context: &ViewAssistantContext) -> Result<(), Error>

This method is called once when a view is created.
Source§

fn resize(&mut self, new_size: &Size) -> Result<(), Error>

Implement this method to to handle when a view is resized.
Source§

fn render( &mut self, render_context: &mut Context, buffer_ready_event: Event, view_context: &ViewAssistantContext, ) -> Result<(), Error>

This method is called when a view needs to be rendered.
Source§

fn handle_input_event( &mut self, context: &mut ViewAssistantContext, event: &Event, ) -> Result<(), Error>

This method is called when input events come to this view. The default implementation calls specific methods for the type of event, so usually one does not need to implement this method. Since the default methods for touch and mouse handle the pointer abstraction, make sure to call them in an implementation of this method if you wish to use that abstraction.
Source§

fn handle_mouse_event( &mut self, context: &mut ViewAssistantContext, event: &Event, mouse_event: &Event, ) -> Result<(), Error>

This method is called when mouse events come to this view. Read more
Source§

fn handle_touch_event( &mut self, context: &mut ViewAssistantContext, event: &Event, touch_event: &Event, ) -> Result<(), Error>

This method is called when touch events come to this view. Read more
Source§

fn handle_pointer_event( &mut self, context: &mut ViewAssistantContext, event: &Event, pointer_event: &Event, ) -> Result<(), Error>

This method is called when the view desires pointer events and a compatible mouse or touch event comes to this view. Read more
Source§

fn handle_keyboard_event( &mut self, context: &mut ViewAssistantContext, event: &Event, keyboard_event: &Event, ) -> Result<(), Error>

This method is called when keyboard events come to this view.
Source§

fn handle_consumer_control_event( &mut self, context: &mut ViewAssistantContext, event: &Event, consumer_control_event: &Event, ) -> Result<(), Error>

This method is called when consumer control events come to this view.
Source§

fn handle_focus_event( &mut self, context: &mut ViewAssistantContext, focused: bool, ) -> Result<(), Error>

This method is called when focus events come from Scenic to this view. It will be called once when a Carnelian app is running directly on the frame buffer, as such views are always focused. See the button sample for an one way to respond to focus.
Source§

fn handle_message(&mut self, message: Message)

This method is called when App::send_message is called with the associated view controller’s ViewKey and the view controller does not handle the message. Read more
Source§

fn uses_pointer_events(&self) -> bool

Whether this view wants touch and mouse events abstracted as input::pointer::Event. Defaults to true.
Source§

fn ownership_changed(&mut self, _owned: bool) -> Result<(), Error>

This method is called when running directly on the display and the ownership of the display changes.
Source§

fn get_render_offset(&mut self) -> Option<i64>

This method is called after setup to get an offset to use when calculating render time. It is only called once.
Source§

fn get_scene(&mut self, size: Size2D<f32, UnknownUnit>) -> Option<&mut Scene>

Implement this method to return a mutable reference to the scene that represents the view.
Source§

fn get_scene_with_contexts( &mut self, render_context: &mut Context, view_context: &ViewAssistantContext, ) -> Option<&mut Scene>

Implement this method to return a mutable reference to the scene that represents the view. Implement this one if you’ll need the various contexts to build a scene.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T, U> IntoExt<U> for T
where U: FromExt<T>,

§

fn into_ext(self) -> U

Performs the conversion.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryIntoExt<U> for T
where U: TryFromExt<T>,

§

type Error = <U as TryFromExt<T>>::Error

§

fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>

Tries to perform the conversion.
§

impl<T> Unless for T

§

fn unless(self, option: Option<T>) -> T

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<St> WithTag for St

§

fn tagged<T>(self, tag: T) -> Tagged<T, St>

Produce a new stream from this one which yields item tupled with a constant tag
§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,