pub struct ServiceKey {
pub id: Option<u32>,
pub name: String,
pub ns: Option<String>,
}Fields§
§id: Option<u32>服务实例唯一id
name: String服务名字
ns: Option<String>命名空间
Implementations§
Source§impl ServiceKey
impl ServiceKey
pub fn new(name: String, ns: Option<String>) -> Self
pub fn id(&self) -> Option<u32>
pub fn has_id(&self) -> bool
Sourcepub fn path_with_id(&self, id: u32) -> String
pub fn path_with_id(&self, id: u32) -> String
组成一个路径
pub fn path_fn(&self, id: u32, f: fn(ServiceKey) -> String) -> String
Sourcepub fn parent_path(&self) -> String
pub fn parent_path(&self) -> String
父路径
pub fn parent_path_fn(&self, f: fn(ServiceKey) -> String) -> String
pub fn root_fn(&self, f: fn(ServiceKey) -> String) -> String
Trait Implementations§
Source§impl Clone for ServiceKey
impl Clone for ServiceKey
Source§fn clone(&self) -> ServiceKey
fn clone(&self) -> ServiceKey
Returns a duplicate of the value. Read more
1.0.0 · 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 ServiceKey
impl Debug for ServiceKey
Source§impl<'de> Deserialize<'de> for ServiceKey
impl<'de> Deserialize<'de> for ServiceKey
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
Source§impl Serialize for ServiceKey
impl Serialize for ServiceKey
Source§impl<'a> TryFrom<&'a [u8]> for ServiceKey
impl<'a> TryFrom<&'a [u8]> for ServiceKey
Source§impl<'a> TryFrom<&'a str> for ServiceKey
impl<'a> TryFrom<&'a str> for ServiceKey
Auto Trait Implementations§
impl Freeze for ServiceKey
impl RefUnwindSafe for ServiceKey
impl Send for ServiceKey
impl Sync for ServiceKey
impl Unpin for ServiceKey
impl UnwindSafe for ServiceKey
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