pub trait SerializableId: Clone {
    fn try_create(id: impl Into<String>) -> Result<Self, Error>
    where
        Self: Sized
; fn as_str(&self) -> &str; fn id(&self) -> String; fn key(&self) -> &'static str; }
Expand description

This trait is for serializing ID to JSON.

It also has some getter functions.

Required Methods

Try to create an instance of SerializableId with String parameter.

It returns None, if id is None.

Get internal str of the Id.

Get internal String of the Id

Field name of Json. If it returns "hoge_id", json will be {"hoge_id": self.id()}.

Implementors