Skip to main content

InviteParams

Struct InviteParams 

Source
pub struct InviteParams {
    pub services: Vec<String>,
    pub app_label: Option<String>,
    pub max_uses: Option<u32>,
    pub peer_nickname: Option<String>,
}
Expand description

Params of Request::Invite: the services the minted invite grants. Rejects unknown fields (so {service: "kb"} — a singular typo — is a loud error, not a silently grants-nothing invite), and the daemon additionally rejects an empty/absent services list (an invite that grants nothing is useless — #34).

Fields§

§services: Vec<String>§app_label: Option<String>

An OPAQUE, caller-chosen label carried through to the redeemer in the pair result (#31). mcpmesh never interprets it (not a nickname, never resolved or authorized) — a per-pairing metadata slot for the embedder (e.g. its own URN). Capped at the daemon; omit for none.

§max_uses: Option<u32>

How many times this invite may be redeemed (#87). Absent = 1, the single-use behaviour every existing caller already gets.

Each redemption runs its OWN SAS ceremony and writes its own mutual peer rows — this is not a shared or group identity, it is N independent pairings that happen to share one secret. Onboarding a team stops being N mint-and-send rounds.

Clamped to MAX_INVITE_USES; 0 is rejected rather than silently meaning “unusable”. A bearer credential’s blast radius is max_uses × TTL, so it is opt-in and capped on purpose. The value actually applied comes back in InviteResult::uses_remaining — read that rather than assuming you got what you asked for.

api_minor >= 35, and sending it to an older daemon FAILS rather than degrading. InviteParams is deny_unknown_fields, so an api_minor < 35 daemon answers -32602 unknown field 'max_uses' — it does not quietly mint a single-use invite. Loud is the right behaviour; omit the field entirely when talking to one.

§peer_nickname: Option<String>

YOUR local name for whoever redeems this invite (#87), overriding the nickname they claim for themselves in the ceremony.

The redeemer’s self-claimed name is usually its hostname, so two same-model laptops collide and the pairing is refused with ERR_NICKNAME_TAKEN. Before this field the only fixes were to ask the other person to rename their machine, or to unpair whoever holds the name. This lets you just call them something else.

Local only: it is never sent to the peer and never affects what they call themselves or you. It does not bypass the collision check — an alias that itself collides is refused identically, because a duplicate display name makes your own <peer>/<service> routing ambiguous whoever chose it.

Rejected with max_uses > 1: one alias applied to every redeemer of a multi-use invite would collide on the second redemption, so it is refused at MINT rather than producing an invite that works exactly once. api_minor >= 39.

Trait Implementations§

Source§

impl Clone for InviteParams

Source§

fn clone(&self) -> InviteParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InviteParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InviteParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for InviteParams

Source§

impl PartialEq for InviteParams

Source§

fn eq(&self, other: &InviteParams) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for InviteParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InviteParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more