Skip to content

Commit d61cdef

Browse files
authored
Merge pull request #285 from DSharifi/dsharifi/implement-debug-public-types
feat: implement `Debug` for all public rust SDK types
2 parents 9316569 + 9350d2b commit d61cdef

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sdk/rust/types/src/dstack.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn replay_rtmr(history: Vec<String>) -> Result<String, FromHexError> {
2828
}
2929

3030
/// Represents an event log entry in the system
31-
#[derive(Serialize, Deserialize)]
31+
#[derive(Debug, Serialize, Deserialize)]
3232
pub struct EventLog {
3333
/// The index of the IMR (Integrity Measurement Register)
3434
pub imr: u32,
@@ -43,7 +43,7 @@ pub struct EventLog {
4343
}
4444

4545
/// Configuration for TLS key generation
46-
#[derive(bon::Builder, Serialize)]
46+
#[derive(Debug, bon::Builder, Serialize)]
4747
pub struct TlsKeyConfig {
4848
/// The subject name for the certificate
4949
#[builder(into, default = String::new())]
@@ -63,7 +63,7 @@ pub struct TlsKeyConfig {
6363
}
6464

6565
/// Response containing a key and its signature chain
66-
#[derive(Serialize, Deserialize)]
66+
#[derive(Debug, Serialize, Deserialize)]
6767
pub struct GetKeyResponse {
6868
/// The key in hexadecimal format
6969
pub key: String,
@@ -82,7 +82,7 @@ impl GetKeyResponse {
8282
}
8383

8484
/// Response containing a quote and associated event log
85-
#[derive(Serialize, Deserialize)]
85+
#[derive(Debug, Serialize, Deserialize)]
8686
pub struct GetQuoteResponse {
8787
/// The attestation quote in hexadecimal format
8888
pub quote: String,
@@ -121,7 +121,7 @@ impl GetQuoteResponse {
121121
}
122122

123123
/// Response containing instance information and attestation data
124-
#[derive(Serialize, Deserialize)]
124+
#[derive(Debug, Serialize, Deserialize)]
125125
pub struct InfoResponse {
126126
/// The application identifier
127127
pub app_id: String,
@@ -156,7 +156,7 @@ impl InfoResponse {
156156
}
157157

158158
/// Trusted Computing Base information structure
159-
#[derive(Serialize, Deserialize)]
159+
#[derive(Debug, Serialize, Deserialize)]
160160
pub struct TcbInfo {
161161
/// The measurement root of trust
162162
pub mrtd: String,
@@ -182,7 +182,7 @@ pub struct TcbInfo {
182182
}
183183

184184
/// Response containing TLS key and certificate chain
185-
#[derive(Serialize, Deserialize)]
185+
#[derive(Debug, Serialize, Deserialize)]
186186
pub struct GetTlsKeyResponse {
187187
/// The TLS key in hexadecimal format
188188
pub key: String,

sdk/rust/types/src/tappd.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn replay_rtmr(history: Vec<String>) -> Result<String, FromHexError> {
6161
}
6262

6363
/// Response from a key derivation request
64-
#[derive(Serialize, Deserialize)]
64+
#[derive(Debug, Serialize, Deserialize)]
6565
pub struct DeriveKeyResponse {
6666
/// The derived key (PEM format for certificates, hex for raw keys)
6767
pub key: String,
@@ -131,7 +131,7 @@ impl DeriveKeyResponse {
131131
}
132132

133133
/// Response from a TDX quote request
134-
#[derive(Serialize, Deserialize)]
134+
#[derive(Debug, Serialize, Deserialize)]
135135
pub struct TdxQuoteResponse {
136136
/// The TDX quote in hexadecimal format
137137
pub quote: String,
@@ -177,7 +177,7 @@ impl TdxQuoteResponse {
177177
}
178178

179179
/// TCB (Trusted Computing Base) information
180-
#[derive(Serialize, Deserialize)]
180+
#[derive(Debug, Serialize, Deserialize)]
181181
pub struct TappdTcbInfo {
182182
/// The measurement root of trust
183183
pub mrtd: String,
@@ -196,7 +196,7 @@ pub struct TappdTcbInfo {
196196
}
197197

198198
/// Response from a Tappd info request
199-
#[derive(Serialize, Deserialize)]
199+
#[derive(Debug, Serialize, Deserialize)]
200200
pub struct TappdInfoResponse {
201201
/// The application identifier
202202
pub app_id: String,

0 commit comments

Comments
 (0)