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: VirtualElementCallWidgetProperties,
config: VirtualElementCallWidgetConfig,
) -> Result<Self, ParseError>
pub fn new_virtual_element_call_widget( props: VirtualElementCallWidgetProperties, config: VirtualElementCallWidgetConfig, ) -> 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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