pub struct ConnectorDescriptor {
pub id: ConnectorId,
pub display_name: String,
pub auth: AuthKind,
pub required_permissions: Vec<ProductPermission>,
pub supports_multiple_accounts: bool,
}Expand description
What a connector is.
Kept separate from the trait so it can be rendered in a settings UI, serialised into the app manifest, and reviewed without instantiating anything.
Fields§
§id: ConnectorId§display_name: String§auth: AuthKind§required_permissions: Vec<ProductPermission>The rights this connector needs at the external service.
Declared, not inferred: a reviewer can see in one place whether an integration asks for write access, and a product can refuse to ship one that does.
supports_multiple_accounts: boolWhether the user may connect several accounts (ADR-0016).
Implementations§
Source§impl ConnectorDescriptor
impl ConnectorDescriptor
pub fn new( id: ConnectorId, display_name: impl Into<String>, auth: AuthKind, ) -> Self
pub fn with_permissions( self, permissions: impl IntoIterator<Item = ProductPermission>, ) -> Self
pub fn single_account(self) -> Self
Sourcepub fn requests_write_access(&self) -> bool
pub fn requests_write_access(&self) -> bool
Whether this connector asks for any write access.
Products that want to stay read-only assert on this in a test.
Trait Implementations§
Source§impl Clone for ConnectorDescriptor
impl Clone for ConnectorDescriptor
Source§fn clone(&self) -> ConnectorDescriptor
fn clone(&self) -> ConnectorDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectorDescriptor
impl Debug for ConnectorDescriptor
Source§impl<'de> Deserialize<'de> for ConnectorDescriptor
impl<'de> Deserialize<'de> for ConnectorDescriptor
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ConnectorDescriptor
impl RefUnwindSafe for ConnectorDescriptor
impl Send for ConnectorDescriptor
impl Sync for ConnectorDescriptor
impl Unpin for ConnectorDescriptor
impl UnsafeUnpin for ConnectorDescriptor
impl UnwindSafe for ConnectorDescriptor
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