#[non_exhaustive]pub struct Protocol<I = ProtocolInstance> {
pub user_fields: Vec<String>,
pub location_fields: Vec<String>,
pub icon: String,
pub field_types: BTreeMap<String, FieldType>,
pub instances: Vec<I>,
}
Expand description
Metadata about a third party protocol.
To create an instance of this type, first create a ProtocolInit
and convert it via
Protocol::from
/ .into()
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.user_fields: Vec<String>
Fields which may be used to identify a third party user.
location_fields: Vec<String>
Fields which may be used to identify a third party location.
icon: String
A content URI representing an icon for the third party protocol.
If the compat-optional
feature is enabled, this field being absent in JSON will result
in an empty string instead of an error when deserializing.
field_types: BTreeMap<String, FieldType>
The type definitions for the fields defined in user_fields
and location_fields
.
instances: Vec<I>
A list of objects representing independent instances of configuration.
Implementations§
Trait Implementations§
Source§impl<'de, I> Deserialize<'de> for Protocol<I>where
I: Deserialize<'de>,
impl<'de, I> Deserialize<'de> for Protocol<I>where
I: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Protocol<I>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Protocol<I>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<I> From<ProtocolInit<I>> for Protocol<I>
impl<I> From<ProtocolInit<I>> for Protocol<I>
Source§fn from(init: ProtocolInit<I>) -> Protocol<I>
fn from(init: ProtocolInit<I>) -> Protocol<I>
Converts to this type from the input type.
Source§impl<I> Serialize for Protocol<I>where
I: Serialize,
impl<I> Serialize for Protocol<I>where
I: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<I> Freeze for Protocol<I>
impl<I> RefUnwindSafe for Protocol<I>where
I: RefUnwindSafe,
impl<I> Send for Protocol<I>where
I: Send,
impl<I> Sync for Protocol<I>where
I: Sync,
impl<I> Unpin for Protocol<I>where
I: Unpin,
impl<I> UnwindSafe for Protocol<I>where
I: UnwindSafe,
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
Mutably borrows from an owned value. Read more