Struct r1cs_file::FieldElement [−][src]
pub struct FieldElement<const FS: usize>(_);
Implementations
Methods from Deref<Target = [u8; FS]>
🔬 This is a nightly-only experimental API. (array_methods
)
🔬 This is a nightly-only experimental API. (
array_methods
)Returns a slice containing the entire array. Equivalent to &s[..]
.
🔬 This is a nightly-only experimental API. (array_methods
)
🔬 This is a nightly-only experimental API. (
array_methods
)Borrows each element and returns an array of references with the same
size as self
.
Example
#![feature(array_methods)] let floats = [3.1, 2.7, -1.0]; let float_refs: [&f64; 3] = floats.each_ref(); assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
This method is particularly useful if combined with other methods, like
map
. This way, you can avoid moving the original
array if its elements are not Copy
.
#![feature(array_methods, array_map)] let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()]; let is_ascii = strings.each_ref().map(|s| s.is_ascii()); assert_eq!(is_ascii, [true, false, true]); // We can still access the original array: it has not been moved. assert_eq!(strings.len(), 3);
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<const FS: usize> RefUnwindSafe for FieldElement<FS>
impl<const FS: usize> Send for FieldElement<FS>
impl<const FS: usize> Sync for FieldElement<FS>
impl<const FS: usize> Unpin for FieldElement<FS>
impl<const FS: usize> UnwindSafe for FieldElement<FS>