Skip to main content

oxilean_kernel/name/
qualifiednameext_traits.rs

1//! # QualifiedNameExt - Trait Implementations
2//!
3//! This module contains trait implementations for `QualifiedNameExt`.
4//!
5//! ## Implemented Traits
6//!
7//! - `FromStr`
8//! - `Display`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use super::types::QualifiedNameExt;
13
14impl std::str::FromStr for QualifiedNameExt {
15    type Err = std::convert::Infallible;
16    fn from_str(s: &str) -> Result<Self, Self::Err> {
17        Ok(Self {
18            parts: s.split('.').map(|p| p.to_string()).collect(),
19        })
20    }
21}
22
23impl std::fmt::Display for QualifiedNameExt {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        write!(f, "{}", self.parts.join("."))
26    }
27}