pub struct FsFits { /* private fields */ }Available on crate feature
fs only.Expand description
A FITS file read from the filesystem.
Implementations§
Source§impl FsFits
impl FsFits
Sourcepub async fn open_async(
path: &Path,
) -> Result<Self, Box<dyn Error + Send + Sync>>
Available on crate feature tokio only.
pub async fn open_async( path: &Path, ) -> Result<Self, Box<dyn Error + Send + Sync>>
tokio only.Opens a file asynchronously, this avoids blocking the tokio runtime
Sourcepub fn save(&self) -> Result<(), Box<dyn Error + Send + Sync>>
pub fn save(&self) -> Result<(), Box<dyn Error + Send + Sync>>
Writes this FITS file back to FsFits::path.
The file is written to a temporary file beside it and then renamed, so a failure part way through leaves the original where it was rather than truncated.
Trait Implementations§
Source§impl Fits for FsFits
impl Fits for FsFits
Source§fn to_vec(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
fn to_vec(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
Serialises this file, primary HDU first and then every extension.
Each HDU contributes its header followed by its data section, both padded out to whole 2880-byte blocks.
Source§type BinTableHDU = FsBinTableHDU
type BinTableHDU = FsBinTableHDU
The kind of binary table HDU this reader produces.
Source§type AsciiTableHDU = FsAsciiTableHDU
type AsciiTableHDU = FsAsciiTableHDU
The kind of ASCII table HDU this reader produces.
Source§fn primary_hdu(&self) -> &Self::ImageHDU
fn primary_hdu(&self) -> &Self::ImageHDU
The primary HDU, which every FITS file has.
Source§fn primary_hdu_mut(&mut self) -> &mut Self::ImageHDU
fn primary_hdu_mut(&mut self) -> &mut Self::ImageHDU
The primary HDU, to be changed.
Source§fn extension_count(&self) -> usize
fn extension_count(&self) -> usize
How many extensions follow the primary HDU.
Source§fn extension_hdu(&self, index: usize) -> Option<&ExtensionHDU<Self>>
fn extension_hdu(&self, index: usize) -> Option<&ExtensionHDU<Self>>
The extension at
index, or None if there is none.Source§fn extension_hdu_mut(&mut self, index: usize) -> Option<&mut ExtensionHDU<Self>>
fn extension_hdu_mut(&mut self, index: usize) -> Option<&mut ExtensionHDU<Self>>
The extension at
index, to be changed.Source§fn extension_hdus(&self) -> impl Iterator<Item = &ExtensionHDU<Self>>
fn extension_hdus(&self) -> impl Iterator<Item = &ExtensionHDU<Self>>
Every extension, in the order they appear in the file.
Source§fn extension_hdus_mut(
&mut self,
) -> impl Iterator<Item = &mut ExtensionHDU<Self>>
fn extension_hdus_mut( &mut self, ) -> impl Iterator<Item = &mut ExtensionHDU<Self>>
Every extension, to be changed.
Source§fn push_extension(&mut self, extension: ExtensionHDU<Self>)
fn push_extension(&mut self, extension: ExtensionHDU<Self>)
Appends an extension after the ones already here.
Source§fn remove_extension(&mut self, index: usize) -> Option<ExtensionHDU<Self>>
fn remove_extension(&mut self, index: usize) -> Option<ExtensionHDU<Self>>
Removes the extension at
index, or returns None if there is none.Auto Trait Implementations§
impl Freeze for FsFits
impl RefUnwindSafe for FsFits
impl Send for FsFits
impl Sync for FsFits
impl Unpin for FsFits
impl UnsafeUnpin for FsFits
impl UnwindSafe for FsFits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more