mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00
refactor(connector): use #[non_exhaustive] on type tokens
This commit is contained in:
parent
5513546d89
commit
f834305563
2 changed files with 16 additions and 20 deletions
|
@ -5,9 +5,8 @@ use ironrdp_pdu::write_buf::WriteBuf;
|
|||
|
||||
use crate::framed::{Framed, FramedRead, FramedWrite};
|
||||
|
||||
pub struct ShouldUpgrade {
|
||||
_priv: (),
|
||||
}
|
||||
#[non_exhaustive]
|
||||
pub struct ShouldUpgrade;
|
||||
|
||||
#[instrument(skip_all)]
|
||||
pub async fn connect_begin<S>(framed: &mut Framed<S>, connector: &mut ClientConnector) -> ConnectorResult<ShouldUpgrade>
|
||||
|
@ -22,24 +21,23 @@ where
|
|||
single_connect_step(framed, connector, &mut buf).await?;
|
||||
}
|
||||
|
||||
Ok(ShouldUpgrade { _priv: () })
|
||||
Ok(ShouldUpgrade)
|
||||
}
|
||||
|
||||
pub fn skip_connect_begin(connector: &mut ClientConnector) -> ShouldUpgrade {
|
||||
assert!(connector.should_perform_security_upgrade());
|
||||
ShouldUpgrade { _priv: () }
|
||||
ShouldUpgrade
|
||||
}
|
||||
|
||||
pub struct Upgraded {
|
||||
_priv: (),
|
||||
}
|
||||
#[non_exhaustive]
|
||||
pub struct Upgraded;
|
||||
|
||||
#[instrument(skip_all)]
|
||||
pub fn mark_as_upgraded(_: ShouldUpgrade, connector: &mut ClientConnector, server_public_key: Vec<u8>) -> Upgraded {
|
||||
trace!("marked as upgraded");
|
||||
trace!("Marked as upgraded");
|
||||
connector.attach_server_public_key(server_public_key);
|
||||
connector.mark_security_upgrade_as_done();
|
||||
Upgraded { _priv: () }
|
||||
Upgraded
|
||||
}
|
||||
|
||||
#[instrument(skip_all)]
|
||||
|
|
|
@ -7,9 +7,8 @@ use ironrdp_pdu::write_buf::WriteBuf;
|
|||
|
||||
use crate::framed::Framed;
|
||||
|
||||
pub struct ShouldUpgrade {
|
||||
_priv: (),
|
||||
}
|
||||
#[non_exhaustive]
|
||||
pub struct ShouldUpgrade;
|
||||
|
||||
#[instrument(skip_all)]
|
||||
pub fn connect_begin<S>(framed: &mut Framed<S>, connector: &mut ClientConnector) -> ConnectorResult<ShouldUpgrade>
|
||||
|
@ -24,24 +23,23 @@ where
|
|||
single_connect_step(framed, connector, &mut buf)?;
|
||||
}
|
||||
|
||||
Ok(ShouldUpgrade { _priv: () })
|
||||
Ok(ShouldUpgrade)
|
||||
}
|
||||
|
||||
pub fn skip_connect_begin(connector: &mut ClientConnector) -> ShouldUpgrade {
|
||||
assert!(connector.should_perform_security_upgrade());
|
||||
ShouldUpgrade { _priv: () }
|
||||
ShouldUpgrade
|
||||
}
|
||||
|
||||
pub struct Upgraded {
|
||||
_priv: (),
|
||||
}
|
||||
#[non_exhaustive]
|
||||
pub struct Upgraded;
|
||||
|
||||
#[instrument(skip_all)]
|
||||
pub fn mark_as_upgraded(_: ShouldUpgrade, connector: &mut ClientConnector, server_public_key: Vec<u8>) -> Upgraded {
|
||||
trace!("marked as upgraded");
|
||||
trace!("Marked as upgraded");
|
||||
connector.attach_server_public_key(server_public_key);
|
||||
connector.mark_security_upgrade_as_done();
|
||||
Upgraded { _priv: () }
|
||||
Upgraded
|
||||
}
|
||||
|
||||
#[instrument(skip_all)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue