bundles: Vec<Option<Note>>,
}
-//---------- private definitions ----------
-
-const BUNDLES_MAX: Index = Index(64);
-
-#[derive(Debug,Clone,Serialize,Deserialize)]
-pub struct Note {
- pub kind: Kind,
- pub state: State,
-}
-
#[derive(Debug,Clone,Serialize,Deserialize)]
pub enum State {
Uploading,
#[derive(Debug,Clone,Serialize,Deserialize)]
pub struct Loaded {
- meta: BundleMeta,
+ pub meta: BundleMeta,
}
+/// returned by start_upload
pub struct Uploading {
instance: Arc<InstanceName>,
id: Id,
file: DigestWrite<BufWriter<fs::File>>,
}
-type BadBundle = String; // todo: make this a newtype
+#[derive(Debug,Copy,Clone,Error)]
+#[error("{0}")]
+#[repr(transparent)]
+pub struct NotBundle(&'static str);
#[derive(Error,Debug)]
pub enum LoadError {
IE(#[from] IE),
}
display_as_debug!{LoadError}
-use LoadError as LE;
-#[derive(Debug,Copy,Clone,Error)]
-#[error("{0}")]
-#[repr(transparent)]
-pub struct NotBundle(&'static str);
+//---------- private definitions ----------
+
+const BUNDLES_MAX: Index = Index(64);
+
+#[derive(Debug,Clone,Serialize,Deserialize)]
+struct Note {
+ pub kind: Kind,
+ pub state: State,
+}
+
+pub type BadBundle = String;
#[derive(Error,Debug)]
enum IncorporateError {
#[error("{0}")] IE(#[from] IE),
}
+use LoadError as LE;
+
//---------- straightformward impls ----------
impl From<Index> for usize {