require all domains to have names

This commit is contained in:
Wez Furlong committed 2019-08-05 11:04:56 -07:00
1 parent af69842fa0
commit 5d6bc3882c
5 files changed
+59 -7

No files matched your search

+14
View File
@@ -61,6 +61,16 @@ pub enum ClientDomainConfig {
Ssh(SshDomain),
}
impl ClientDomainConfig {
fn name(&self) -> &str {
match self {
ClientDomainConfig::Unix(unix) => &unix.name,
ClientDomainConfig::Tls(tls) => &tls.name,
ClientDomainConfig::Ssh(ssh) => &ssh.name,
}
}
}
impl ClientInner {
pub fn new(local_domain_id: DomainId, client: Client) -> Self {
// Assumption: that the domain id on the other end is
@@ -133,6 +143,10 @@ impl Domain for ClientDomain {
self.local_domain_id
}
fn domain_name(&self) -> &str {
self.config.name()
}
fn spawn(
&self,
size: PtySize,