TLV and TV abstractions complete
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
use crate::cfdp::lv::Lv;
|
||||
use crate::cfdp::pdu::{FileDirectiveType, PduHeader};
|
||||
use crate::cfdp::ChecksumType;
|
||||
|
||||
pub struct MetadataParams {
|
||||
pub struct MetadataGenericParams {
|
||||
closure_requested: bool,
|
||||
checksum_type: ChecksumType,
|
||||
file_size: u64,
|
||||
//src_file_name:
|
||||
}
|
||||
|
||||
pub struct MetadataPdu {
|
||||
pub struct MetadataPdu<'src_name, 'dest_name> {
|
||||
pdu_header: PduHeader,
|
||||
file_directive: FileDirectiveType,
|
||||
metadata_params: MetadataParams,
|
||||
metadata_params: MetadataGenericParams,
|
||||
src_file_name: Option<Lv<'src_name>>,
|
||||
dest_file_name: Option<Lv<'dest_name>>,
|
||||
}
|
||||
|
@ -63,14 +63,21 @@ impl Display for PduError {
|
||||
)
|
||||
}
|
||||
PduError::ByteConversionError(e) => {
|
||||
write!(f, "low level byte conversion error: {e}")
|
||||
write!(f, "{}", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl Error for PduError {}
|
||||
impl Error for PduError {
|
||||
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||
match self {
|
||||
PduError::ByteConversionError(e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ByteConversionError> for PduError {
|
||||
fn from(value: ByteConversionError) -> Self {
|
||||
|
Reference in New Issue
Block a user