#[non_exhaustive]pub enum Focus {
Livekit(LivekitFocus),
LegacyLivekit(LivekitFocus),
}Expand description
Description of the SFU/Focus a membership can be connected to.
A focus can be any server powering the MatrixRTC session (SFU, MCU). It serves as a node to redistribute RTC streams.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Livekit(LivekitFocus)
A LiveKit focus, as defined in the merged state of MSC4195.
LegacyLivekit(LivekitFocus)
Use Focus::Livekit instead unless you require backwards compatibility with older versions of MSC4195.
A LiveKit focus with the livekit type used by implementations of earlier versions of
MSC4195.
Implementations§
Source§impl Focus
impl Focus
Sourcepub fn new(focus_type: &str, data: JsonObject) -> Result<Self>
pub fn new(focus_type: &str, data: JsonObject) -> Result<Self>
A constructor to create a custom focus.
Prefer to use the public variants of Focus where possible; this constructor is meant to
be used for unsupported focus types only and does not allow setting arbitrary data for
supported ones.
§Errors
Returns an error if the focus_type is known and deserialization of data to the
corresponding Focus variant fails.
Sourcepub fn focus_type(&self) -> &str
pub fn focus_type(&self) -> &str
Returns the type of this focus.
Sourcepub fn data(&self) -> Cow<'_, JsonObject>
pub fn data(&self) -> Cow<'_, JsonObject>
Returns the associated data.
The returned JSON object won’t contain the type field, please use
.focus_type() to access that.
Prefer to use the public variants of Focus where possible; this method is meant to be
used for custom focus types only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Focus
impl<'de> Deserialize<'de> for Focus
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for Focus
impl StructuralPartialEq for Focus
Auto Trait Implementations§
impl Forget for Focus
impl Freeze for Focus
impl Move for Focus
impl RefUnwindSafe for Focus
impl Send for Focus
impl Sync for Focus
impl Unpin for Focus
impl UnsafeUnpin for Focus
impl UnwindSafe for Focus
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.