RealtimeRef

Struct RealtimeRef 

Source
pub struct RealtimeRef(/* private fields */);

Implementations§

Source§

impl RealtimeRef

Source

pub fn has_widget(&self, widget: &WidgetRef) -> RealtimeRef

Source

pub fn borrow(&self) -> Option<Ref<'_, Realtime>>

Source

pub fn borrow_mut(&self) -> Option<RefMut<'_, Realtime>>

Source

pub fn borrow_if_eq(&self, widget: &WidgetRef) -> Option<Ref<'_, Realtime>>

Source

pub fn borrow_mut_if_eq( &self, widget: &WidgetRef, ) -> Option<RefMut<'_, Realtime>>

Source§

impl RealtimeRef

Source

pub fn set_realtime_channel(&mut self, channel: RealtimeChannel)

Source

pub fn set_bot_entity_id(&mut self, cx: &mut Cx, bot_entity_id: EntityId)

Source

pub fn connection_requested(&mut self) -> bool

Source

pub fn take_conversation_messages(&mut self) -> Vec<Message>

Source

pub fn reset_state(&mut self, cx: &mut Cx)

Source

pub fn set_chat_controller( &mut self, chat_controller: Option<Arc<Mutex<ChatController>>>, )

Methods from Deref<Target = WidgetRef>§

pub fn is_empty(&self) -> bool

pub fn downgrade(&self) -> WidgetWeakRef

pub fn handle_event_with( &self, cx: &mut Cx, event: &Event, scope: &mut Scope<'_, '_>, sweep_area: Area, )

§handle event with a sweep area

this is used for the sweep event, this fn can help to pass the event into popup, the widget should implement the handle_event_with fn in impl Widget for $Widget

§Example
impl Widget for Button {
fn handle_event_with(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope, sweep_area: Area) {
    let uid = self.widget_uid();

    if self.animator_handle_event(cx, event).must_redraw() {
        self.draw_button.redraw(cx);
    }
    match event.hits_with_options(cx, self.draw_button.area(), HitOptions::new().with_sweep_area(sweep_area) ) {
        Hit::FingerDown(f_down) => {
            if self.grab_key_focus {
                 cx.set_key_focus(self.sweep_area);
            }
            cx.widget_action(uid, &scope.path, GButtonEvent::Pressed(f_down.modifiers));
            self.animator_play(cx, ids!(hover.pressed));
        }
        _ =>()
    }
}
§Details

See Flexible Popup

pub fn handle_event( &self, cx: &mut Cx, event: &Event, scope: &mut Scope<'_, '_>, )

pub fn script_call( &self, vm: &mut ScriptVm<'_>, method: LiveId, args: ScriptValue, ) -> ScriptAsyncResult

pub fn script_result( &self, vm: &mut ScriptVm<'_>, id: ScriptAsyncId, result: ScriptValue, )

pub fn widget_uid(&self) -> WidgetUid

Returns the unique ID (UID) of this widget.

Returns WidgetUid(0) if the widget is currently borrowed or is empty.

pub fn try_widget_uid(&self) -> Option<WidgetUid>

pub fn widget_type_id(&self) -> Option<TypeId>

pub fn area(&self) -> Area

pub fn set_action_data<T>(&self, data: T)
where T: ActionTrait + PartialEq,

pub fn set_action_data_always<T>(&self, data: T)
where T: ActionTrait,

pub fn children(&self, visit: &mut dyn FnMut(LiveId, WidgetRef))

pub fn register_as_ui_root(&self, vm: &mut ScriptVm<'_>)

pub fn try_children(&self, visit: &mut dyn FnMut(LiveId, WidgetRef)) -> bool

pub fn find_widgets_from_point( &self, cx: &Cx, point: Vec2d, found: &mut dyn FnMut(&WidgetRef), )

pub fn point_hits_area(&self, cx: &Cx, point: Vec2d) -> bool

pub fn find_interactive_widget_from_point( &self, cx: &Cx, point: Vec2d, ) -> Option<WidgetRef>

pub fn is_interactive(&self) -> bool

pub fn selection_text_len(&self) -> usize

pub fn selection_point_to_char_index( &self, cx: &Cx, abs: Vec2d, ) -> Option<usize>

pub fn selection_set(&self, anchor: usize, cursor: usize)

pub fn selection_clear(&self)

pub fn selection_select_all(&self)

pub fn selection_get_text_for_range(&self, start: usize, end: usize) -> String

pub fn selection_get_full_text(&self) -> String

pub fn child_by_path(&self, path: &[LiveId]) -> WidgetRef

pub fn child(&self, id: LiveId) -> WidgetRef

pub fn widget(&self, cx: &Cx, path: &[LiveId]) -> WidgetRef

pub fn widgets(&self, cx: &Cx, paths: &[&[LiveId]]) -> WidgetSet

pub fn widget_set(&self, cx: &Cx, paths: &[&[LiveId]]) -> WidgetSet

pub fn widget_flood(&self, cx: &Cx, path: &[LiveId]) -> WidgetRef

pub fn widgets_flood(&self, cx: &Cx, paths: &[&[LiveId]]) -> WidgetSet

pub fn draw_walk( &self, cx: &mut Cx2d<'_, '_>, scope: &mut Scope<'_, '_>, walk: Walk, ) -> Result<(), WidgetRef>

pub fn draw_walk_all( &self, cx: &mut Cx2d<'_, '_>, scope: &mut Scope<'_, '_>, walk: Walk, )

pub fn draw_3d_all(&self, cx: &mut Cx3d<'_, '_>, scope: &mut Scope<'_, '_>)

pub fn draw_3d( &mut self, cx: &mut Cx3d<'_, '_>, scope: &mut Scope<'_, '_>, ) -> Result<(), WidgetRef>

pub fn draw( &mut self, cx: &mut Cx2d<'_, '_>, scope: &mut Scope<'_, '_>, ) -> Result<(), WidgetRef>

pub fn draw_unscoped(&mut self, cx: &mut Cx2d<'_, '_>) -> Result<(), WidgetRef>

pub fn walk(&self, cx: &mut Cx) -> Walk

pub fn redraw(&self, cx: &mut Cx)

pub fn set_visible(&self, cx: &mut Cx, visible: bool)

pub fn visible(&self) -> bool

pub fn text(&self) -> String

pub fn set_text(&self, cx: &mut Cx, v: &str)

pub fn key_focus(&self, cx: &Cx) -> bool

pub fn set_key_focus(&self, cx: &mut Cx)

pub fn set_disabled(&self, cx: &mut Cx, disabled: bool)

pub fn disabled(&self, cx: &Cx) -> bool

pub fn draw_all(&self, cx: &mut Cx2d<'_, '_>, scope: &mut Scope<'_, '_>)

pub fn action_data(&self) -> Option<Arc<dyn ActionTrait>>

pub fn filter_actions<'a>( &'a self, actions: &'a [Box<dyn ActionTrait>], ) -> impl Iterator<Item = &'a WidgetAction>

pub fn draw_all_unscoped(&self, cx: &mut Cx2d<'_, '_>)

pub fn borrow_mut<T>(&self) -> Option<RefMut<'_, T>>
where T: 'static + Widget,

pub fn cast_inner_mut<T>(&self) -> Option<RefMut<'_, T>>
where T: 'static,

pub fn borrow<T>(&self) -> Option<Ref<'_, T>>
where T: 'static + Widget,

pub fn cast_inner<T>(&self) -> Option<Ref<'_, T>>
where T: 'static,

Trait Implementations§

Source§

impl Clone for RealtimeRef

Source§

fn clone(&self) -> RealtimeRef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RealtimeRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RealtimeRef

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for RealtimeRef

Source§

type Target = WidgetRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for RealtimeRef

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

§

fn ref_cast_type_id(&self) -> TypeId
where Self: 'static,

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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.

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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