MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_changelist

Method get_changelist

atomic-remote/src/http/queries.rs:79–119  ·  view source on GitHub ↗

Get the changelist for a view starting from a position. # Arguments `view` - The name of the view to query. `from` - The starting position (sequence number). # Returns A vector of changelist entries, starting from the given position.

(
        &self,
        view: &str,
        from: u64,
    )

Source from the content-addressed store, hash-verified

77 ///
78 /// A vector of changelist entries, starting from the given position.
79 pub async fn get_changelist(
80 &self,
81 view: &str,
82 from: u64,
83 ) -> RemoteResult<Vec<ChangelistEntry>> {
84 let url = format!("{}?view={}&changelist={}", self.base_url, view, from);
85 debug!("GET changelist: {}", url);
86
87 let response = self
88 .client
89 .get(&url)
90 .send()
91 .await
92 .map_err(|e| RemoteError::connection_failed(&url, e))?;
93
94 crate::check_min_version_header(response.headers());
95 let status = response.status();
96 trace!("GET changelist response status: {}", status);
97
98 match status {
99 StatusCode::OK => {
100 let text = response
101 .text()
102 .await
103 .map_err(|e| RemoteError::connection_failed(&url, e))?;
104
105 trace!("GET changelist response body length: {} bytes", text.len());
106
107 parse_changelist(&text)
108 }
109 StatusCode::NOT_FOUND => Err(RemoteError::view_not_found(view)),
110 StatusCode::UNAUTHORIZED | StatusCode::FORBIDDEN => {
111 let msg = response.text().await.unwrap_or_default();
112 Err(RemoteError::auth_failed(&url, msg))
113 }
114 _ => {
115 let msg = response.text().await.unwrap_or_default();
116 Err(RemoteError::http(status.as_u16(), msg))
117 }
118 }
119 }
120
121 /// Get the view ID (UUID).
122 ///

Callers 6

run_asyncMethod · 0.80
run_asyncMethod · 0.80
run_asyncMethod · 0.80
dichotomy_changelistMethod · 0.80
compute_deltaMethod · 0.80

Calls 5

check_min_version_headerFunction · 0.85
parse_changelistFunction · 0.85
textMethod · 0.80
getMethod · 0.65
statusMethod · 0.45

Tested by

no test coverage detected