@@ -107,21 +107,28 @@ impl Tags {
107107 self . list_with_opts ( ListOptions :: hash_seq ( ) ) . await
108108 }
109109
110- /// Deletes a tag.
111- pub async fn delete_with_opts ( & self , options : DeleteOptions ) -> super :: RequestResult < ( ) > {
110+ /// Deletes a tag, with full control over options. All other delete methods
111+ /// wrap this.
112+ ///
113+ /// Returns the number of tags actually removed. Attempting to delete a non-existent tag will *not* fail.
114+ pub async fn delete_with_opts ( & self , options : DeleteOptions ) -> super :: RequestResult < u64 > {
112115 trace ! ( "{:?}" , options) ;
113- self . client . rpc ( options) . await ??;
114- Ok ( ( ) )
116+ let deleted = self . client . rpc ( options) . await ??;
117+ Ok ( deleted )
115118 }
116119
117120 /// Deletes a tag.
118- pub async fn delete ( & self , name : impl AsRef < [ u8 ] > ) -> super :: RequestResult < ( ) > {
121+ ///
122+ /// Returns the number of tags actually removed. Attempting to delete a non-existent tag will *not* fail.
123+ pub async fn delete ( & self , name : impl AsRef < [ u8 ] > ) -> super :: RequestResult < u64 > {
119124 self . delete_with_opts ( DeleteOptions :: single ( name. as_ref ( ) ) )
120125 . await
121126 }
122127
123128 /// Deletes a range of tags.
124- pub async fn delete_range < R , E > ( & self , range : R ) -> super :: RequestResult < ( ) >
129+ ///
130+ /// Returns the number of tags actually removed. Attempting to delete a non-existent tag will *not* fail.
131+ pub async fn delete_range < R , E > ( & self , range : R ) -> super :: RequestResult < u64 >
125132 where
126133 R : RangeBounds < E > ,
127134 E : AsRef < [ u8 ] > ,
@@ -130,13 +137,17 @@ impl Tags {
130137 }
131138
132139 /// Delete all tags with the given prefix.
133- pub async fn delete_prefix ( & self , prefix : impl AsRef < [ u8 ] > ) -> super :: RequestResult < ( ) > {
140+ ///
141+ /// Returns the number of tags actually removed. Attempting to delete a non-existent tag will *not* fail.
142+ pub async fn delete_prefix ( & self , prefix : impl AsRef < [ u8 ] > ) -> super :: RequestResult < u64 > {
134143 self . delete_with_opts ( DeleteOptions :: prefix ( prefix. as_ref ( ) ) )
135144 . await
136145 }
137146
138147 /// Delete all tags. Use with care. After this, all data will be garbage collected.
139- pub async fn delete_all ( & self ) -> super :: RequestResult < ( ) > {
148+ ///
149+ /// Returns the number of tags actually removed. Attempting to delete a non-existent tag will *not* fail.
150+ pub async fn delete_all ( & self ) -> super :: RequestResult < u64 > {
140151 self . delete_with_opts ( DeleteOptions {
141152 from : None ,
142153 to : None ,
0 commit comments