pub struct Cable {
pub data: DataClass,
pub emarker: bool,
pub declared_amps: f64,
pub length_m: f64,
}Expand description
A cable as it physically exists, not as it is marketed.
Fields§
§data: DataClass§emarker: boolWhether an e-marker chip is present in the plug.
declared_amps: f64Current the e-marker declares, in amps. Ignored when emarker is false.
length_m: f64Implementations§
Source§impl Cable
impl Cable
Sourcepub fn allowed_amps(&self) -> f64
pub fn allowed_amps(&self) -> f64
Current the cable is permitted to carry, in amps.
Without an e-marker the ceiling is 3 A no matter how thick the copper is. This is a protocol limit, not a thermal one — the source has no way to learn the cable is capable, so it must assume it is not.
Sourcepub fn max_watts_at(&self, volts: f64) -> f64
pub fn max_watts_at(&self, volts: f64) -> f64
Maximum power the cable can pass at a given negotiated voltage, in watts.
Sourcepub fn can_deliver(&self, target_watts: f64, volts: f64) -> bool
pub fn can_deliver(&self, target_watts: f64, volts: f64) -> bool
Whether the cable can reach a target wattage at a given voltage.
Sourcepub fn passive_length_is_plausible(&self) -> bool
pub fn passive_length_is_plausible(&self) -> bool
Whether passive operation is plausible at this length for the data class.
Signal loss scales with length and with frequency, so the faster the class the shorter the passive cable can be. A 3 m 40 Gbps cable exists, but it contains active signal conditioning and costs accordingly — which is why long “Thunderbolt” cables are expensive and short ones are not.