pub struct WidgetSettings { /* private fields */ }
experimental-widgets
only.Expand description
Settings of the widget.
Implementations§
Source§impl WidgetSettings
impl WidgetSettings
Sourcepub fn new_virtual_element_call_widget(
props: VirtualElementCallWidgetOptions,
) -> Result<Self, ParseError>
pub fn new_virtual_element_call_widget( props: VirtualElementCallWidgetOptions, ) -> Result<Self, ParseError>
WidgetSettings
are usually created from a state event.
(currently unimplemented)
In some cases the client wants to create custom WidgetSettings
for specific rooms based on other conditions.
This function returns a WidgetSettings
object which can be used
to setup a widget using run_client_widget_api
and to generate the correct url for the widget.
§Arguments
props
- A struct containing the configuration parameters for a element call widget.
Source§impl WidgetSettings
impl WidgetSettings
Sourcepub fn new(
id: String,
init_on_content_load: bool,
raw_url: &str,
) -> Result<Self, ParseError>
pub fn new( id: String, init_on_content_load: bool, raw_url: &str, ) -> Result<Self, ParseError>
Create a new WidgetSettings instance
Sourcepub fn init_on_content_load(&self) -> bool
pub fn init_on_content_load(&self) -> bool
Whether or not the widget should be initialized on load message
(ContentLoad
message), or upon creation/attaching of the widget to
the SDK’s state machine that drives the API.
Sourcepub fn raw_url(&self) -> &Url
pub fn raw_url(&self) -> &Url
This contains the url from the widget state event.
In this url placeholders can be used to pass information from the client
to the widget. Possible values are: $matrix_widget_id
,
$matrix_display_name
, etc.
§Examples
http://widget.domain?username=$userId
will become
http://widget.domain?username=@user_matrix_id:server.domain
.
Sourcepub fn base_url(&self) -> Option<Url>
pub fn base_url(&self) -> Option<Url>
Get the base url of the widget. Used as the target for PostMessages. In
case the widget is in a webview and not an IFrame. It contains the
schema and the authority e.g. https://my.domain.org
. A postmessage would
be sent using: postMessage(myMessage, widget_base_url)
.
Sourcepub async fn generate_webview_url(
&self,
room: &Room,
props: ClientProperties,
) -> Result<Url, ParseError>
pub async fn generate_webview_url( &self, room: &Room, props: ClientProperties, ) -> Result<Url, ParseError>
Trait Implementations§
Source§impl Clone for WidgetSettings
impl Clone for WidgetSettings
Source§fn clone(&self) -> WidgetSettings
fn clone(&self) -> WidgetSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for WidgetSettings
impl RefUnwindSafe for WidgetSettings
impl Send for WidgetSettings
impl Sync for WidgetSettings
impl Unpin for WidgetSettings
impl UnwindSafe for WidgetSettings
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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