Struct matrix_sdk::widget::WidgetSettings
source · 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 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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>