pub struct CPTExp {
pub layers: Vec<CPTLayer>,
pub name: String,
}
Expand description
Represents a collection of CPT data points.
A CPTExp
struct contains multiple CPTLayer
instances, forming a complete CPT profile.
Fields§
§layers: Vec<CPTLayer>
§name: String
Implementations§
Source§impl CPTExp
impl CPTExp
Sourcepub fn new(layers: Vec<CPTLayer>, name: String) -> Self
pub fn new(layers: Vec<CPTLayer>, name: String) -> Self
Creates a new CPT
instance.
§Arguments
layers
- A vector ofCPTLayer
instances.name
- The name of the CPT profile.
Sourcepub fn add_layer(&mut self, layer: CPTLayer)
pub fn add_layer(&mut self, layer: CPTLayer)
Adds a new CPTLayer
instance to the CPTExp
collection.
§Arguments
layer
- TheCPTLayer
instance to add to the collection.
Sourcepub fn get_layer_at_depth(&self, depth: f64) -> &CPTLayer
pub fn get_layer_at_depth(&self, depth: f64) -> &CPTLayer
Retrieves the CPT layer corresponding to a given depth.
This function finds the first layer whose depth is greater than or equal to the given depth
.
If no such layer is found, it returns the last layer in the list.
§Arguments
depth
- The depth at which to search for a CPT layer.
§Returns
A reference to the matching CPTLayer
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CPTExp
impl<'de> Deserialize<'de> for CPTExp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CPTExp
impl RefUnwindSafe for CPTExp
impl Send for CPTExp
impl Sync for CPTExp
impl Unpin for CPTExp
impl UnwindSafe for CPTExp
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