Struct RoomUUID

Source
pub struct RoomUUID(pub(crate) String);
Expand description

A hex string representing a room UUID for MPC operations.

A RoomUUID is created for each multi-party computation operation (such as key generation, signing, refresh, etc.) and acts as a session identifier to synchronize all involved parties. All parties participating in the same operation must use the same room UUID.

§Usage

Rooms are created by one party (typically the coordinator) and the UUID is shared with all other participants. The room coordinates the communication and synchronization between parties during the MPC protocol execution.

§Examples

use sodot_mpc::RoomUUID;

// Create a RoomUUID from a string
let room_id = "00000002fddbfdea06319915f5862909".to_string();
let room_uuid = RoomUUID::new(room_id);
println!("Created room: {:?}", room_uuid);

// In tests, you can access the inner value
#[cfg(test)]
{
    assert_eq!(room_uuid.as_str(), "00000002fddbfdea06319915f5862909");
}

Tuple Fields§

§0: String

Implementations§

Source§

impl RoomUUID

Source

pub fn new(uuid: String) -> Self

Creates a new RoomUUID from a string.

§Arguments
  • uuid - A string representing the room UUID
§Returns

A new RoomUUID instance.

Source

pub fn as_str(&self) -> &str

Returns the room UUID as a string slice.

Trait Implementations§

Source§

impl Clone for RoomUUID

Source§

fn clone(&self) -> RoomUUID

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RoomUUID

Source§

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

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

impl FromFFI for RoomUUID

Source§

fn parse_ffi<'a>(s: impl Into<Cow<'a, str>>) -> Self

Parses this type from an FFI string representation. Read more
Source§

impl ToFFI for RoomUUID

Source§

type Str<'a> = &'a str

The string type returned by the FFI conversion. Read more
Source§

fn ffi<'a>(&'a self) -> Self::Str<'a>

Converts this value to its FFI string representation. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.