pub struct Form { /* private fields */ }Expand description
Form data structure (Phase 2-A: Enhanced with client-side validation rules)
Implementations§
Source§impl Form
impl Form
Sourcepub fn new() -> Form
Available on native and crate feature forms only.
pub fn new() -> Form
native and crate feature forms only.Create a new empty form
§Examples
use reinhardt_forms::Form;
let form = Form::new();
assert!(!form.is_bound());
assert!(form.fields().is_empty());Sourcepub fn with_initial(initial: HashMap<String, Value>) -> Form
Available on native and crate feature forms only.
pub fn with_initial(initial: HashMap<String, Value>) -> Form
native and crate feature forms only.Create a new form with initial data
§Examples
use reinhardt_forms::Form;
use std::collections::HashMap;
use serde_json::json;
let mut initial = HashMap::new();
initial.insert("name".to_string(), json!("John"));
let form = Form::with_initial(initial);
assert_eq!(form.initial().get("name"), Some(&json!("John")));Sourcepub fn with_prefix(prefix: String) -> Form
Available on native and crate feature forms only.
pub fn with_prefix(prefix: String) -> Form
native and crate feature forms only.Create a new form with a field prefix
§Examples
use reinhardt_forms::Form;
let form = Form::with_prefix("user".to_string());
assert_eq!(form.prefix(), "user");
assert_eq!(form.add_prefix_to_field_name("email"), "user-email");Sourcepub fn add_field(&mut self, field: Box<dyn FormField>)
Available on native and crate feature forms only.
pub fn add_field(&mut self, field: Box<dyn FormField>)
native and crate feature forms only.Add a field to the form
§Examples
use reinhardt_forms::{Form, CharField, Field};
let mut form = Form::new();
let field = CharField::new("username".to_string());
form.add_field(Box::new(field));
assert_eq!(form.fields().len(), 1);Sourcepub fn bind(&mut self, data: HashMap<String, Value>)
Available on native and crate feature forms only.
pub fn bind(&mut self, data: HashMap<String, Value>)
native and crate feature forms only.Bind form data for validation
§Examples
use reinhardt_forms::Form;
use std::collections::HashMap;
use serde_json::json;
let mut form = Form::new();
let mut data = HashMap::new();
data.insert("username".to_string(), json!("john"));
form.bind(data);
assert!(form.is_bound());Sourcepub fn is_valid(&mut self) -> bool
Available on native and crate feature forms only.
pub fn is_valid(&mut self) -> bool
native and crate feature forms only.Validate the form and return true if all fields are valid
§Examples
use reinhardt_forms::{Form, CharField, Field};
use std::collections::HashMap;
use serde_json::json;
let mut form = Form::new();
form.add_field(Box::new(CharField::new("username".to_string())));
let mut data = HashMap::new();
data.insert("username".to_string(), json!("john"));
form.bind(data);
assert!(form.is_valid());
assert!(form.errors().is_empty());
assert_eq!(form.cleaned_data().get("username"), Some(&json!("john")));Sourcepub fn cleaned_data(&self) -> &HashMap<String, Value>
Available on native and crate feature forms only.
pub fn cleaned_data(&self) -> &HashMap<String, Value>
native and crate feature forms only.Returns the cleaned (validated) form data.
Sourcepub fn errors(&self) -> &HashMap<String, Vec<String>>
Available on native and crate feature forms only.
pub fn errors(&self) -> &HashMap<String, Vec<String>>
native and crate feature forms only.Returns the current validation errors keyed by field name.
Sourcepub fn add_error(
&mut self,
field_name: impl Into<String>,
message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_error( &mut self, field_name: impl Into<String>, message: impl Into<String>, )
native and crate feature forms only.Append an error message to the given field’s error list.
Use ALL_FIELDS_KEY for non-field (form-wide / cross-field) errors so
they are exposed through the same inspection API as per-field errors.
Sourcepub fn is_bound(&self) -> bool
Available on native and crate feature forms only.
pub fn is_bound(&self) -> bool
native and crate feature forms only.Returns whether the form has been bound with submitted data.
Sourcepub fn fields(&self) -> &[Box<dyn FormField>]
Available on native and crate feature forms only.
pub fn fields(&self) -> &[Box<dyn FormField>]
native and crate feature forms only.Returns the list of fields registered on this form.
Sourcepub fn initial(&self) -> &HashMap<String, Value>
Available on native and crate feature forms only.
pub fn initial(&self) -> &HashMap<String, Value>
native and crate feature forms only.Returns the initial (default) values for the form.
Sourcepub fn set_initial(&mut self, initial: HashMap<String, Value>)
Available on native and crate feature forms only.
pub fn set_initial(&mut self, initial: HashMap<String, Value>)
native and crate feature forms only.Set initial data for the form
§Examples
use reinhardt_forms::Form;
use std::collections::HashMap;
use serde_json::json;
let mut form = Form::new();
let mut initial = HashMap::new();
initial.insert("name".to_string(), json!("John"));
form.set_initial(initial);Sourcepub fn has_changed(&self) -> bool
Available on native and crate feature forms only.
pub fn has_changed(&self) -> bool
native and crate feature forms only.Check if any field has changed from its initial value
§Examples
use reinhardt_forms::{Form, CharField, Field};
use std::collections::HashMap;
use serde_json::json;
let mut initial = HashMap::new();
initial.insert("name".to_string(), json!("John"));
let mut form = Form::with_initial(initial);
form.add_field(Box::new(CharField::new("name".to_string())));
let mut data = HashMap::new();
data.insert("name".to_string(), json!("Jane"));
form.bind(data);
assert!(form.has_changed());Sourcepub fn get_field(&self, name: &str) -> Option<&dyn FormField>
Available on native and crate feature forms only.
pub fn get_field(&self, name: &str) -> Option<&dyn FormField>
native and crate feature forms only.Looks up a field by name, returning a reference if found.
Sourcepub fn remove_field(&mut self, name: &str) -> Option<Box<dyn FormField>>
Available on native and crate feature forms only.
pub fn remove_field(&mut self, name: &str) -> Option<Box<dyn FormField>>
native and crate feature forms only.Removes and returns a field by name, or None if not found.
Sourcepub fn field_count(&self) -> usize
Available on native and crate feature forms only.
pub fn field_count(&self) -> usize
native and crate feature forms only.Returns the number of fields registered on this form.
Sourcepub fn add_clean_function<F>(&mut self, f: F)
Available on native and crate feature forms only.
pub fn add_clean_function<F>(&mut self, f: F)
native and crate feature forms only.Add a custom clean function for form validation
§Examples
use reinhardt_forms::Form;
use std::collections::HashMap;
use serde_json::json;
let mut form = Form::new();
form.add_clean_function(|data| {
if data.get("password") != data.get("confirm_password") {
Err(reinhardt_forms::FormError::Validation("Passwords do not match".to_string()))
} else {
Ok(())
}
});Sourcepub fn add_field_clean_function<F>(&mut self, field_name: &str, f: F)
Available on native and crate feature forms only.
pub fn add_field_clean_function<F>(&mut self, field_name: &str, f: F)
native and crate feature forms only.Add a custom clean function for a specific field
§Examples
use reinhardt_forms::Form;
use serde_json::json;
let mut form = Form::new();
form.add_field_clean_function("email", |value| {
if let Some(email) = value.as_str() {
if email.contains("@") {
Ok(value.clone())
} else {
Err(reinhardt_forms::FormError::Validation("Invalid email".to_string()))
}
} else {
Ok(value.clone())
}
});Sourcepub fn validation_rules(&self) -> &[ValidationRule]
Available on native and crate feature forms only.
pub fn validation_rules(&self) -> &[ValidationRule]
native and crate feature forms only.Sourcepub fn add_min_length_validator(
&mut self,
field_name: impl Into<String>,
min: usize,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_min_length_validator( &mut self, field_name: impl Into<String>, min: usize, error_message: impl Into<String>, )
native and crate feature forms only.Add a minimum length validator (Phase 2-A)
Adds a validator that checks if a string field has at least min characters.
This validator is executed on the client-side for immediate feedback.
Security Note: Client-side validation is for UX enhancement only. Server-side validation is still mandatory for security.
§Arguments
field_name: Name of the field to validatemin: Minimum required lengtherror_message: Error message to display on validation failure
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_min_length_validator("password", 8, "Password must be at least 8 characters");Sourcepub fn add_max_length_validator(
&mut self,
field_name: impl Into<String>,
max: usize,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_max_length_validator( &mut self, field_name: impl Into<String>, max: usize, error_message: impl Into<String>, )
native and crate feature forms only.Add a maximum length validator (Phase 2-A)
Adds a validator that checks if a string field has at most max characters.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_max_length_validator("username", 50, "Username must be at most 50 characters");Sourcepub fn add_pattern_validator(
&mut self,
field_name: impl Into<String>,
pattern: impl Into<String>,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_pattern_validator( &mut self, field_name: impl Into<String>, pattern: impl Into<String>, error_message: impl Into<String>, )
native and crate feature forms only.Add a pattern validator (Phase 2-A)
Adds a validator that checks if a string field matches a regex pattern.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_pattern_validator("code", "^[A-Z]{3}$", "Code must be 3 uppercase letters");Sourcepub fn add_min_value_validator(
&mut self,
field_name: impl Into<String>,
min: f64,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_min_value_validator( &mut self, field_name: impl Into<String>, min: f64, error_message: impl Into<String>, )
native and crate feature forms only.Add a minimum value validator (Phase 2-A)
Adds a validator that checks if a numeric field is at least min.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_min_value_validator("age", 0.0, "Age must be non-negative");Sourcepub fn add_max_value_validator(
&mut self,
field_name: impl Into<String>,
max: f64,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_max_value_validator( &mut self, field_name: impl Into<String>, max: f64, error_message: impl Into<String>, )
native and crate feature forms only.Add a maximum value validator (Phase 2-A)
Adds a validator that checks if a numeric field is at most max.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_max_value_validator("age", 150.0, "Age must be at most 150");Sourcepub fn add_email_validator(
&mut self,
field_name: impl Into<String>,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_email_validator( &mut self, field_name: impl Into<String>, error_message: impl Into<String>, )
native and crate feature forms only.Add an email format validator (Phase 2-A)
Adds a validator that checks if a field contains a valid email format.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_email_validator("email", "Enter a valid email address");Sourcepub fn add_url_validator(
&mut self,
field_name: impl Into<String>,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_url_validator( &mut self, field_name: impl Into<String>, error_message: impl Into<String>, )
native and crate feature forms only.Add a URL format validator (Phase 2-A)
Adds a validator that checks if a field contains a valid URL format.
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_url_validator("website", "Enter a valid URL");Sourcepub fn add_fields_equal_validator(
&mut self,
field_names: Vec<String>,
error_message: impl Into<String>,
target_field: Option<String>,
)
Available on native and crate feature forms only.
pub fn add_fields_equal_validator( &mut self, field_names: Vec<String>, error_message: impl Into<String>, target_field: Option<String>, )
native and crate feature forms only.Add a fields equality validator (Phase 2-A)
Adds a validator that checks if multiple fields have equal values. Commonly used for password confirmation.
§Arguments
field_names: Names of fields to compare for equalityerror_message: Error message to display on validation failuretarget_field: Target field for error display (None = non-field error)
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_fields_equal_validator(
vec!["password".to_string(), "password_confirm".to_string()],
"Passwords do not match",
Some("password_confirm".to_string())
);Sourcepub fn add_validator_rule(
&mut self,
field_name: impl Into<String>,
validator_id: impl Into<String>,
params: Value,
error_message: impl Into<String>,
)
Available on native and crate feature forms only.
pub fn add_validator_rule( &mut self, field_name: impl Into<String>, validator_id: impl Into<String>, params: Value, error_message: impl Into<String>, )
native and crate feature forms only.Add a client-side validator reference (Phase 2-A)
Adds a reference to a reinhardt-validators Validator. This validator is executed on the client-side for immediate feedback.
Security Note: Client-side validation is for UX enhancement only. Server-side validation is still mandatory for security.
§Arguments
field_name: Name of the field to validatevalidator_id: Validator identifier (e.g., “email”, “url”, “min_length”)params: Validator parameters as JSONerror_message: Error message to display on validation failure
§Examples
use reinhardt_forms::Form;
use serde_json::json;
let mut form = Form::new();
form.add_validator_rule(
"email",
"email",
json!({}),
"Enter a valid email address"
);
form.add_validator_rule(
"username",
"min_length",
json!({"min": 3}),
"Username must be at least 3 characters"
);Sourcepub fn add_date_range_validator(
&mut self,
start_field: impl Into<String>,
end_field: impl Into<String>,
error_message: Option<String>,
)
Available on native and crate feature forms only.
pub fn add_date_range_validator( &mut self, start_field: impl Into<String>, end_field: impl Into<String>, error_message: Option<String>, )
native and crate feature forms only.Helper: Add a date range validator (Phase 2-A)
Adds a validator that checks if end_date >= start_date.
§Arguments
start_field: Name of the start date fieldend_field: Name of the end date fielderror_message: Error message (optional, defaults to a standard message)
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_date_range_validator("start_date", "end_date", None);Sourcepub fn add_numeric_range_validator(
&mut self,
min_field: impl Into<String>,
max_field: impl Into<String>,
error_message: Option<String>,
)
Available on native and crate feature forms only.
pub fn add_numeric_range_validator( &mut self, min_field: impl Into<String>, max_field: impl Into<String>, error_message: Option<String>, )
native and crate feature forms only.Helper: Add a numeric range validator (Phase 2-A)
Adds a validator that checks if max >= min.
§Arguments
min_field: Name of the minimum value fieldmax_field: Name of the maximum value fielderror_message: Error message (optional, defaults to a standard message)
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.add_numeric_range_validator("min_price", "max_price", None);Sourcepub fn set_csrf_token(&mut self, token: String)
Available on native and crate feature forms only.
pub fn set_csrf_token(&mut self, token: String)
native and crate feature forms only.Enable CSRF protection for this form.
When enabled, is_valid() will check that the submitted data
contains a matching CSRF token.
§Arguments
token- The expected CSRF token for this form
§Examples
use reinhardt_forms::Form;
let mut form = Form::new();
form.set_csrf_token("abc123".to_string());
assert!(form.csrf_enabled());Sourcepub fn csrf_enabled(&self) -> bool
Available on native and crate feature forms only.
pub fn csrf_enabled(&self) -> bool
native and crate feature forms only.Check if CSRF protection is enabled
Sourcepub fn csrf_token(&self) -> Option<&str>
Available on native and crate feature forms only.
pub fn csrf_token(&self) -> Option<&str>
native and crate feature forms only.Get the CSRF token, if set
Sourcepub fn prefix(&self) -> &str
Available on native and crate feature forms only.
pub fn prefix(&self) -> &str
native and crate feature forms only.Returns the field name prefix for this form.
Sourcepub fn set_prefix(&mut self, prefix: String)
Available on native and crate feature forms only.
pub fn set_prefix(&mut self, prefix: String)
native and crate feature forms only.Sets the field name prefix for this form.
Sourcepub fn add_prefix_to_field_name(&self, field_name: &str) -> String
Available on native and crate feature forms only.
pub fn add_prefix_to_field_name(&self, field_name: &str) -> String
native and crate feature forms only.Returns the field name with the form prefix prepended (e.g., “prefix-field”).
Sourcepub fn render_css_media(&self, css_files: &[&str]) -> String
Available on native and crate feature forms only.
pub fn render_css_media(&self, css_files: &[&str]) -> String
native and crate feature forms only.Render CSS <link> tags for form media with HTML-escaped paths.
All paths are escaped using escape_attribute() to prevent XSS
via malicious CSS file paths.
§Arguments
css_files- Slice of CSS file paths to include
§Examples
use reinhardt_forms::Form;
let form = Form::new();
let html = form.render_css_media(&["/static/forms.css"]);
assert!(html.contains("href=\"/static/forms.css\""));Sourcepub fn render_js_media(&self, js_files: &[&str]) -> String
Available on native and crate feature forms only.
pub fn render_js_media(&self, js_files: &[&str]) -> String
native and crate feature forms only.Render JS <script> tags for form media with HTML-escaped paths.
All paths are escaped using escape_attribute() to prevent XSS
via malicious JS file paths.
§Arguments
js_files- Slice of JS file paths to include
§Examples
use reinhardt_forms::Form;
let form = Form::new();
let html = form.render_js_media(&["/static/forms.js"]);
assert!(html.contains("src=\"/static/forms.js\""));Sourcepub fn get_bound_field<'a>(&'a self, name: &str) -> Option<BoundField<'a>>
Available on native and crate feature forms only.
pub fn get_bound_field<'a>(&'a self, name: &str) -> Option<BoundField<'a>>
native and crate feature forms only.Returns a BoundField with the field’s submitted data and errors attached.
Source§impl Form
Safe field access by name.
impl Form
Safe field access by name.
Returns None if the field is not found instead of panicking.
§Examples
use reinhardt_forms::{Form, CharField, Field};
let mut form = Form::new();
form.add_field(Box::new(CharField::new("name".to_string())));
assert!(form.get("name").is_some());
assert!(form.get("nonexistent").is_none());Trait Implementations§
Source§impl FormExt for Form
impl FormExt for Form
Source§fn to_metadata(&self) -> FormMetadata
fn to_metadata(&self) -> FormMetadata
Auto Trait Implementations§
impl !RefUnwindSafe for Form
impl !UnwindSafe for Form
impl Freeze for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnsafeUnpin for Form
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = !
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.