Skip to content

Commit 09f8edc

Browse files
kevin-peaseLeonardTibben
authored andcommitted
Add documentation
1 parent 9b28592 commit 09f8edc

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

stellar_rust_sdk/src/models/response_models.rs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
use crate::Getters;
22
use serde::{Deserialize, Serialize};
33

4+
/// Represents the navigational links in a response.
5+
///
6+
/// Contains the links to the current, next, and previous pages of the response.
7+
///
48
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
59
pub struct ResponseLinks {
610
#[serde(rename = "self")]
@@ -9,22 +13,33 @@ pub struct ResponseLinks {
913
pub prev: Option<Link>,
1014
}
1115

16+
/// Represents a navigational link in a response.
17+
///
18+
/// Contains an optional url.
19+
///
1220
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
1321
pub struct Link {
1422
pub href: Option<String>,
1523
}
1624

17-
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
18-
pub struct Embedded<T> {
19-
pub records: Vec<T>,
20-
}
21-
25+
/// Represents a navigational link in a response.
26+
///
27+
/// Contains an optional url, and an optional boolean to indicate whether a link is templated or not.
28+
///
2229
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
2330
pub struct TemplateLink {
2431
pub href: Option<String>,
2532
pub templated: Option<bool>,
2633
}
2734

35+
/// Represents a collection of results in a response.
36+
///
37+
/// Contains a vector, which can hold any type of record returned by the API.
38+
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
39+
pub struct Embedded<T> {
40+
pub records: Vec<T>,
41+
}
42+
2843
/// Represents the authorization and control flags for an asset in the all assets response.
2944
///
3045
/// Details the various boolean flags that are
@@ -45,4 +60,4 @@ pub struct Flags {
4560
/// A `bool` indicating whether the asset supports the clawback operation.
4661
/// If `true`, the issuer can claw back the asset from user accounts.
4762
auth_clawback_enabled: bool,
48-
}
63+
}

0 commit comments

Comments
 (0)