pub struct PadicFieldRestriction { /* private fields */ }Expand description
Explicit precision restriction between two fixed-cap p-adic fields.
Implementations§
Source§impl PadicFieldRestriction
impl PadicFieldRestriction
Sourcepub fn new(
source: PadicField,
target_absolute_precision: u64,
) -> Result<Self, PadicRestrictionError>
pub fn new( source: PadicField, target_absolute_precision: u64, ) -> Result<Self, PadicRestrictionError>
Construct the unique digit-discarding map to target_absolute_precision.
Sourcepub fn source(&self) -> &PadicField
pub fn source(&self) -> &PadicField
Source fixed-cap field.
Sourcepub fn target(&self) -> &PadicField
pub fn target(&self) -> &PadicField
Target fixed-cap field.
Sourcepub fn apply(
&self,
value: &PadicElement,
) -> Result<PadicElement, PadicRestrictionError>
pub fn apply( &self, value: &PadicElement, ) -> Result<PadicElement, PadicRestrictionError>
Discard high digits while preserving the represented valuation when visible.
Sourcepub fn verify(&self) -> Result<(), VerificationError>
pub fn verify(&self) -> Result<(), VerificationError>
Recheck the source/target relationship defining this map.
Sourcepub fn to_json(&self) -> Result<String, NoetherError>
pub fn to_json(&self) -> Result<String, NoetherError>
Canonical JSON containing both endpoint contexts.
Sourcepub fn from_json(value: &str) -> Result<Self, NoetherError>
pub fn from_json(value: &str) -> Result<Self, NoetherError>
Deserialize and revalidate both endpoint contexts and their precision relation.
Trait Implementations§
Source§impl Clone for PadicFieldRestriction
impl Clone for PadicFieldRestriction
Source§fn clone(&self) -> PadicFieldRestriction
fn clone(&self) -> PadicFieldRestriction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CoefficientMap for PadicFieldRestriction
impl CoefficientMap for PadicFieldRestriction
Source§type Source = PadicField
type Source = PadicField
Source coefficient context.
Source§type Target = PadicField
type Target = PadicField
Target coefficient context.
Source§type Error = PadicRestrictionError
type Error = PadicRestrictionError
Scalar application failure.
Source§fn apply(&self, value: &PadicElement) -> Result<PadicElement, Self::Error>
fn apply(&self, value: &PadicElement) -> Result<PadicElement, Self::Error>
Apply the map after checking that
value belongs to the exact source.Source§impl Debug for PadicFieldRestriction
impl Debug for PadicFieldRestriction
Source§impl Display for PadicFieldRestriction
impl Display for PadicFieldRestriction
Source§impl PartialEq for PadicFieldRestriction
impl PartialEq for PadicFieldRestriction
Source§impl SemanticType for PadicFieldRestriction
impl SemanticType for PadicFieldRestriction
Source§const TYPE_ID: &'static str = "noether/numthy/PadicFieldRestriction@1"
const TYPE_ID: &'static str = "noether/numthy/PadicFieldRestriction@1"
Versioned, language-neutral semantic identity.
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
Serialize without backend- or language-specific identity.
Source§fn describe() -> &'static TypeDescription
fn describe() -> &'static TypeDescription
Return static discovery metadata for the type.
impl Eq for PadicFieldRestriction
impl StructuralPartialEq for PadicFieldRestriction
Auto Trait Implementations§
impl Freeze for PadicFieldRestriction
impl RefUnwindSafe for PadicFieldRestriction
impl Send for PadicFieldRestriction
impl Sync for PadicFieldRestriction
impl Unpin for PadicFieldRestriction
impl UnwindSafe for PadicFieldRestriction
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