-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented get_file_info() for File attachable.
- Loading branch information
Showing
7 changed files
with
39 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use hdk::prelude::*; | ||
use zome_utils::*; | ||
|
||
use zome_delivery_types::*; | ||
use crate::utils::ensure_parcel_is_file; | ||
|
||
|
||
/// Return manifest | ||
#[hdk_extern] | ||
pub fn get_file_info(eh: EntryHash) -> ExternResult<ParcelManifest> { | ||
std::panic::set_hook(Box::new(zome_panic_hook)); | ||
let manifest: ParcelManifest = get_typed_from_eh(eh)?; | ||
ensure_parcel_is_file(&manifest.description)?; | ||
Ok(manifest) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ mod utils; | |
mod probe_public_files; | ||
mod write_file_chunk; | ||
mod respond_to_file_share_notice; | ||
mod get_file_info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters