pub fn from_shared(s: impl Into<Bytes>) -> Result<Self, Error> {
        let s = str::from_utf8(&s.into())
            .map_err(|e| Error::new_invalid_uri().with(e))?
            .to_string();
        if s.starts_with("unix:") {
            let uds_filepath = s
                .strip_prefix("unix://")
                .or_else(|| s.strip_prefix("unix:"))
                .ok_or(Error::new_invalid_uri())?;
            Ok(Self::new_uds(uds_filepath))
        } else {
            let uri = Uri::from_maybe_shared(s).map_err(|e| Error::new_invalid_uri().with(e))?;
            Ok(Self::from(uri))
        }
    }
Convert an `Endpoint` from shared bytes.

```
# use tonic::transport::Endpoint;
Endpoint::from_shared("https://example.com".to_string());
```
tonic/src/transport/channel/endpoint.rs