Skip to content

Commit ddab6cb

Browse files
committed
simplify
1 parent e01966b commit ddab6cb

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

objectstore-server/src/auth/service.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use objectstore_service::id::{ObjectContext, ObjectId};
22
use objectstore_service::{
3-
BatchInsertResult, DeleteResult, GetResult, InsertResult, InsertStream, PayloadStream,
4-
StorageService,
3+
DeleteResult, GetResult, InsertResult, InsertStream, PayloadStream, StorageService,
54
};
65
use objectstore_types::{Metadata, Permission};
76

@@ -76,14 +75,4 @@ impl AuthAwareService {
7675
self.assert_authorized(Permission::ObjectDelete, id.context())?;
7776
self.service.delete_object(id).await
7877
}
79-
80-
/// Auth-aware wrapper around [`StorageService::insert_objects`].
81-
pub async fn insert_objects(
82-
&self,
83-
context: ObjectContext,
84-
inserts: InsertStream,
85-
) -> BatchInsertResult {
86-
self.assert_authorized(Permission::ObjectWrite, &context)?;
87-
self.service.insert_objects(context, inserts).await
88-
}
8978
}

objectstore-service/src/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ mod backend;
1010
pub mod id;
1111

1212
use std::path::Path;
13-
use std::pin::Pin;
1413
use std::sync::Arc;
1514
use std::sync::atomic::{AtomicU64, Ordering};
1615
use std::time::Instant;
1716

1817
use bytes::{Bytes, BytesMut};
19-
use futures_util::Stream;
2018
use futures_util::{StreamExt, TryStreamExt, stream::BoxStream};
2119
use objectstore_types::Metadata;
2220

@@ -95,12 +93,6 @@ pub type InsertResult = anyhow::Result<ObjectId>;
9593
/// Result type for delete operations.
9694
pub type DeleteResult = anyhow::Result<()>;
9795

98-
/// Type alias to represent a stream of insert operations.
99-
pub type InsertStream =
100-
Pin<Box<dyn Stream<Item = Result<(Metadata, Bytes), anyhow::Error>> + Send>>;
101-
/// Result type for batch insert operations.
102-
pub type BatchInsertResult = anyhow::Result<Vec<InsertResult>>;
103-
10496
impl StorageService {
10597
/// Creates a new `StorageService` with the specified configuration.
10698
pub async fn new(
@@ -289,15 +281,6 @@ impl StorageService {
289281

290282
Ok(())
291283
}
292-
293-
/// TODO
294-
pub async fn insert_objects(
295-
&self,
296-
_context: ObjectContext,
297-
_inserts: InsertStream,
298-
) -> BatchInsertResult {
299-
todo!();
300-
}
301284
}
302285

303286
fn is_tombstoned(result: &Option<(Metadata, PayloadStream)>) -> bool {

0 commit comments

Comments
 (0)