Skip to main content

SDC

Struct SDC 

Source
pub struct SDC {
Show 15 fields pub strand_names: Vec<String>, pub glue_names: Vec<String>, pub quencher_id: Option<Tile>, pub quencher_concentration: Molar, pub reporter_id: Option<Tile>, pub fluorophore_concentration: Molar, pub scaffold: Array1<Glue>, pub strand_concentration: Array1<Molar>, pub scaffold_concentration: Molar, pub strand_glues: Array2<Glue>, pub colors: Vec<[u8; 4]>, pub kf: PerMolarSecond, pub friends_btm: Vec<Vec<Tile>>, pub delta_g_matrix: Array2<KcalPerMol>, pub entropy_matrix: Array2<KcalPerMolKelvin>, /* private fields */
}

Fields§

§strand_names: Vec<String>§glue_names: Vec<String>§quencher_id: Option<Tile>

Identifies the strand that serves as a binding site for the quencher

§quencher_concentration: Molar

Concentration of the quencher

§reporter_id: Option<Tile>

Name of the reporter tile

§fluorophore_concentration: Molar

Concentration of the fluorophore,

§scaffold: Array1<Glue>

Glues on the scaffold. We only allow a single 1D scaffold here, which is repeated over the i-axis.

§strand_concentration: Array1<Molar>

All strands in the system, they are represented by tiles with only glue on the south, west, and east (nothing can stick to the top of a strand)

§scaffold_concentration: Molar

The concentration of the scaffold

§strand_glues: Array2<Glue>

Glues of a given strand by id

Note that the glues will be sorted in the following manner: [ (0) – [left glue, bottom glue, right glue] … (n) – [left glue, bottom glue, right glue] ]

§colors: Vec<[u8; 4]>

Each strand will be given a color so that it can be easily identified when illustrated

§kf: PerMolarSecond

The (de)attachment rates will depend on this constant(for the system) value

§friends_btm: Vec<Vec<Tile>>

Set of tiles that can stick to scaffold gap with a given glue

§delta_g_matrix: Array2<KcalPerMol>

Delta G at 37 degrees C in the formula to generate the glue strengths

§entropy_matrix: Array2<KcalPerMolKelvin>

S in the formula to generate the glue strengths

Implementations§

Source§

impl SDC

Source

pub fn change_temperature_to(&mut self, temperature: impl Into<Kelvin>)

Update the systems temperature. Accepts either Celsius or Kelvin as input.

Source

pub fn n_scaffolds<S: State>(&self, state: &S) -> usize

Source

pub fn total_tile_count<S: State>(&self, state: &S, tile: Tile) -> usize

Source

pub fn fill_energy_array(&mut self)

Fill the energy_bonds array

Source

pub fn monomer_detachment_rate_at_point<S: State>( &self, state: &S, scaffold_point: PointSafe2, ) -> PerSecond

Source

pub fn monomer_change_rate_at_point<S: State>( &self, state: &S, scaffold_point: PointSafe2, ) -> PerSecond

Source

pub fn choose_monomer_change_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)

Source

pub fn choose_monomer_attachment_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)

Source

pub fn choose_monomer_detachment_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)

Source

pub fn system_states(&self) -> Vec<Vec<u32>>

Source

pub fn boltzman_function(&self, attachments: &[u32]) -> f64

Source

pub fn partition_function_full(&self) -> f64

Source

pub fn partition_function(&self) -> BigFloat

Notes:

  • This only works for a single scaffold type.
Source

pub fn partial_partition_function( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> BigFloat

This calculates a partial partition for the system. At each location, it takes a Vec. If the Vec is empty, then no constraints are applied. If the Vec is not empty, then the partition function is only calculated for the tiles in the Vec. 0 corresponds to the site being empty.

Source

pub fn log_partition_function(&self) -> f64

Source

pub fn log_partial_partition_function( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> f64

Source

pub fn probability_of_constrained_configurations( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> f64

Source

pub fn probability_of_state(&self, system: &[u32]) -> f64

Source§

impl SDC

Source

pub fn mfe_configuration(&self) -> (Vec<Tile>, f64)

Get the mfe configuration, as well as its energy

Source§

impl SDC

Source

pub fn from_params(params: SDCParams) -> Self

Source§

impl SDC

Source

pub fn py_evolve<'py>( &mut self, state: PyStateOrStates<'py>, for_events: Option<u64>, total_events: Option<u64>, for_time: Option<f64>, total_time: Option<f64>, size_min: Option<u32>, size_max: Option<u32>, for_wall_time: Option<f64>, require_strong_bound: bool, show_window: bool, start_window_paused: bool, parallel: bool, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, py: Python<'py>, ) -> PyResult<Py<PyAny>>

Evolve a state (or states), with some bounds on the simulation.

If evolving multiple states, the bounds are applied per-state.

§Parameters

state : State or Sequence[State] The state or states to evolve. for_events : int, optional Stop evolving each state after this many events. total_events : int, optional Stop evelving each state when the state’s total number of events (including previous events) reaches this. for_time : float, optional Stop evolving each state after this many seconds of simulated time. total_time : float, optional Stop evolving each state when the state’s total time (including previous steps) reaches this. size_min : int, optional Stop evolving each state when the state’s number of tiles is less than or equal to this. size_max : int, optional Stop evolving each state when the state’s number of tiles is greater than or equal to this. for_wall_time : float, optional Stop evolving each state after this many seconds of wall time. require_strong_bound : bool Require that the stopping conditions are strong, i.e., they are guaranteed to be eventually satisfied under normal conditions. show_window : bool Show a graphical UI window while evolving (requires rgrow-gui to be installed, and a single state). start_window_paused : bool If show_window is True, start the GUI window in a paused state. Defaults to True. parallel : bool Use multiple threads. initial_timescale : float, optional If show_window is True, set the initial timescale (sim_time/real_time) in the GUI. None means unlimited. initial_max_events_per_sec : int, optional If show_window is True, set the initial max events per second limit in the GUI. None means unlimited.

§Returns

EvolveOutcome or ListEvolveOutcome The outcome (stopping condition) of the evolution. If evolving a single state, returns a single outcome.

Source

pub fn print_debug(&self)

Source

pub fn write_json(&self, filename: &str) -> Result<(), RgrowError>

Write the system to a JSON file.

§Parameters

filename : str The name of the file to write to.

Source

pub fn read_json(filename: &str) -> Result<Self, RgrowError>

Read a system from a JSON file.

§Parameters

filename : str The name of the file to read from.

§Returns

Self

Source

pub fn py_place_tile( &self, state: &mut PyState, point: (usize, usize), tile: u32, replace: bool, ) -> Result<f64, RgrowError>

Place a tile at a point in the given state.

This updates tile counts and rates but does not increment the event counter or record events in the state tracker.

§Parameters

state : PyState The state to modify. point : tuple of int The coordinates at which to place the tile (i, j). tile : int The tile number to place. replace : bool, optional If True (default), any existing tile at the target site is removed first. If False, raises an error if the site is occupied.

§Returns

float The energy change from placing the tile.

Source

pub fn py_find_first_critical_state( &mut self, end_state: &PyState, config: CriticalStateConfig, py: Python<'_>, ) -> PyResult<Option<CriticalStateResult>>

Source

pub fn py_find_last_critical_state( &mut self, end_state: &PyState, config: CriticalStateConfig, py: Python<'_>, ) -> PyResult<Option<CriticalStateResult>>

Trait Implementations§

Source§

impl Clone for SDC

Source§

fn clone(&self) -> SDC

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SDC

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SDC

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<SDC> for SystemEnum

Source§

fn from(v: SDC) -> SystemEnum

Converts to this type from the input type.
Source§

impl<'py> IntoPyObject<'py> for SDC

Source§

type Target = SDC

The Python output type
Source§

type Output = Bound<'py, <SDC as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for SDC

Source§

type Frozen = False

Whether the pyclass is frozen. Read more
Source§

impl PyClassBaseType for SDC

Source§

type LayoutAsBase = PyClassObject<SDC>

Source§

type BaseNativeType = <SDC as PyClassImpl>::BaseNativeType

Source§

type Initializer = PyClassInitializer<SDC>

Source§

type PyClassMutability = <SDC as PyClassImpl>::PyClassMutability

Source§

impl PyClassImpl for SDC

Source§

const IS_BASETYPE: bool = true

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
Source§

const IS_IMMUTABLE_TYPE: bool = false

#[pyclass(immutable_type)]
Source§

const RAW_DOC: &'static CStr = c"\x00"

Docstring for the class provided on the struct or enum. Read more
Source§

const DOC: &'static CStr

Fully rendered class doc, including the text_signature if a constructor is defined. Read more
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = SendablePyClass<SDC>

This handles following two situations: Read more
Source§

type Inventory = Pyo3MethodsInventoryForSDC

Source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

fn items_iter() -> PyClassItemsIter

Source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

Source§

fn dict_offset() -> Option<isize>

Source§

fn weaklist_offset() -> Option<isize>

Source§

impl PyClassNewTextSignature for SDC

Source§

const TEXT_SIGNATURE: &'static str = "(params)"

Source§

impl PyTypeInfo for SDC

Source§

const NAME: &'static str = "SDC"

Class name.
Source§

const MODULE: Option<&'static str>

Module name, if any.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
Source§

fn type_object(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
Source§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
Source§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
Source§

impl Serialize for SDC

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl System for SDC

Source§

fn update_after_event<St: State>(&self, state: &mut St, event: &Event)

Source§

fn perform_event<St: State>(&self, state: &mut St, event: &Event) -> f64

Perform a particular event/change to a state. Do not update the state’s time/etc, or rates, which should be done in update_after_event and take_single_step.
Source§

fn event_rate_at_point<St: State>( &self, state: &St, p: PointSafeHere, ) -> PerSecond

Returns the total event rate at a given point. These should correspond with the events chosen by choose_event_at_point.
Source§

fn choose_event_at_point<St: State>( &self, state: &St, point: PointSafe2, acc: PerSecond, ) -> (Event, f64)

Given a point, and an accumulated random rate choice acc (which should be less than the total rate at the point), return the event that should take place, and the rate of that particular event.
Source§

fn seed_locs(&self) -> Vec<(PointSafe2, Tile)>

Returns a vector of (point, tile number) tuples for the seed tiles, useful for populating an initial state.
Source§

fn calc_mismatch_locations<St: State>(&self, state: &St) -> Array2<usize>

Returns an array of mismatch locations. At each point, mismatches are designated by 8N+4E+2S+1W.
Source§

fn set_param( &mut self, name: &str, value: Box<dyn Any>, ) -> Result<NeededUpdate, GrowError>

Source§

fn get_param(&self, name: &str) -> Result<Box<dyn Any>, GrowError>

Source§

fn list_parameters(&self) -> Vec<ParameterInfo>

Source§

fn system_info(&self) -> String

Source§

fn new_state<St: StateWithCreate + State>( &self, params: St::Params, ) -> Result<St, GrowError>

Source§

fn calc_n_tiles<St: State>(&self, state: &St) -> NumTiles

Source§

fn take_single_step<St: State>( &self, state: &mut St, max_time_step: Second, ) -> StepOutcome

Source§

fn evolve<St: State>( &self, state: &mut St, bounds: EvolveBounds, ) -> Result<EvolveOutcome, GrowError>

Source§

fn evolve_states<St: State>( &mut self, states: &mut [St], bounds: EvolveBounds, ) -> Vec<Result<EvolveOutcome, GrowError>>

Source§

fn set_point<St: State>( &self, state: &mut St, point: Point, tile: Tile, ) -> Result<&Self, GrowError>

Source§

fn set_safe_point<St: State>( &self, state: &mut St, point: PointSafe2, tile: Tile, ) -> &Self

Source§

fn set_points<St: State>( &self, state: &mut St, changelist: &[(Point, Tile)], ) -> &Self

Source§

fn set_safe_points<St: State>( &self, state: &mut St, changelist: &[(PointSafe2, Tile)], ) -> &Self

Source§

fn place_tile<St: State>( &self, state: &mut St, point: PointSafe2, tile: Tile, replace: bool, ) -> Result<f64, GrowError>

Place a tile at a particular location, handling double tiles appropriately for kTAM. For kTAM, placing a “real” tile (left/top part of double tile) will also place the corresponding “fake” tile (right/bottom part). Attempting to place a “fake” tile directly will place the corresponding “real” tile instead. Read more
Source§

fn configure_empty_state<St: State>( &self, state: &mut St, ) -> Result<(), GrowError>

Source§

fn calc_mismatches<St: State>(&self, state: &St) -> usize

Source§

fn update_points<St: State>(&self, state: &mut St, points: &[PointSafeHere])

Source§

fn update_state<St: State>(&self, state: &mut St, needed: &NeededUpdate)

Source§

fn extract_model_name(info: &str) -> String

Source§

fn evolve_in_window<St: State>( &mut self, state: &mut St, block: Option<usize>, start_paused: bool, bounds: EvolveBounds, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, ) -> Result<EvolveOutcome, RgrowError>

Source§

fn calc_dimers(&self) -> Result<Vec<DimerInfo>, GrowError>

Returns information on dimers that the system can form.
Source§

fn clone_state<St: StateWithCreate>(&self, initial_state: &St) -> St

Source§

fn clone_state_into_state<St: StateWithCreate>( &self, initial_state: &St, target: &mut St, )

Source§

fn clone_state_into_empty_state<St: StateWithCreate>( &self, initial_state: &St, target: &mut St, )

Source§

impl TileBondInfo for SDC

Source§

fn tile_colors(&self) -> &Vec<[u8; 4]>

Source§

fn tile_names(&self) -> &[String]

Source§

fn bond_names(&self) -> &[String]

Source§

fn tile_color(&self, tile_number: Tile) -> [u8; 4]

Source§

fn tile_name(&self, tile_number: Tile) -> &str

Source§

fn bond_name(&self, bond_number: usize) -> &str

Source§

fn tile_style(&self, tile_number: Tile) -> TileStyle

By default, we will make a tile be just a solid clor, but a system may override this to customize how a tile looks.
Source§

fn tile_pixels(&self, tile_number: Tile, size: usize) -> SpriteSquare

Turn the tile into a sprite
Source§

fn tile_blocker_mask(&self, _tile_number: Tile) -> u8

Return a bitmask of sides that have blockers attached. Bit layout: 0b_WESN (bit 0 = North, bit 1 = East, bit 2 = South, bit 3 = West). Default: no blockers.
Source§

impl TryInto<SDC> for SystemEnum

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<SDC, <Self as TryInto<SDC>>::Error>

Performs the conversion.
Source§

impl DerefToPyAny for SDC

Source§

impl ExtractPyClassWithClone for SDC

Auto Trait Implementations§

§

impl Freeze for SDC

§

impl RefUnwindSafe for SDC

§

impl Send for SDC

§

impl Sync for SDC

§

impl Unpin for SDC

§

impl UnsafeUnpin for SDC

§

impl UnwindSafe for SDC

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<S> DynSystem for S
where S: System, SystemEnum: From<S>,

Source§

fn evolve( &self, state: &mut StateEnum, bounds: EvolveBounds, ) -> Result<EvolveOutcome, GrowError>

Simulate a single state, until reaching specified stopping conditions.
Source§

fn evolve_states( &mut self, states: &mut [&mut StateEnum], bounds: EvolveBounds, ) -> Vec<Result<EvolveOutcome, GrowError>>

Evolve a list of states, in parallel.
Source§

fn setup_state(&self, state: &mut StateEnum) -> Result<(), GrowError>

Source§

fn evolve_in_window( &mut self, state: &mut StateEnum, block: Option<usize>, start_paused: bool, bounds: EvolveBounds, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, ) -> Result<EvolveOutcome, RgrowError>

Source§

fn calc_mismatches(&self, state: &StateEnum) -> usize

Source§

fn calc_mismatch_locations( &self, state: &StateEnum, ) -> ArrayBase<OwnedRepr<usize>, Dim<[usize; 2]>>

Source§

fn set_param( &mut self, name: &str, value: Box<dyn Any>, ) -> Result<NeededUpdate, GrowError>

Source§

fn get_param(&self, name: &str) -> Result<Box<dyn Any>, GrowError>

Source§

fn update_state(&self, state: &mut StateEnum, needed: &NeededUpdate)

Source§

fn run_ffs(&mut self, config: &FFSRunConfig) -> Result<FFSRunResult, RgrowError>

Source§

fn system_info(&self) -> String

Source§

fn calc_committor( &mut self, initial_state: &StateEnum, cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, num_trials: usize, ) -> Result<f64, GrowError>

Source§

fn calc_committor_adaptive( &self, initial_state: &StateEnum, cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(f64, usize), GrowError>

Source§

fn calc_committors_adaptive( &self, initial_states: &[&StateEnum], cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(Vec<f64>, Vec<usize>), GrowError>

Source§

fn calc_forward_probability( &mut self, initial_state: &StateEnum, forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, num_trials: usize, ) -> Result<f64, GrowError>

Source§

fn calc_forward_probability_adaptive( &self, initial_state: &StateEnum, forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(f64, usize), GrowError>

Source§

fn calc_forward_probabilities_adaptive( &self, initial_states: &[&StateEnum], forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(Vec<f64>, Vec<usize>), GrowError>

Source§

fn calc_committor_threshold_test( &mut self, initial_state: &StateEnum, cutoff_size: u32, threshold: f64, z_level: f64, max_time: Option<f64>, max_events: Option<u64>, max_trials: Option<usize>, return_on_max_trials: bool, ) -> Result<(bool, f64, usize, bool), GrowError>

Determine whether the committor probability for a state is above or below a threshold with a specified confidence level using adaptive sampling. Read more
Source§

fn find_first_critical_state( &mut self, end_state: &StateEnum, config: &CriticalStateConfig, ) -> Result<Option<CriticalStateResult>, GrowError>

Source§

fn find_last_critical_state( &mut self, end_state: &StateEnum, config: &CriticalStateConfig, ) -> Result<Option<CriticalStateResult>, GrowError>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, 'py, T> FromPyObject<'a, 'py> for T
where T: PyClass + Clone + ExtractPyClassWithClone,

Source§

type Error = PyClassGuardError<'a, 'py>

The type returned in the event of a conversion error. Read more
Source§

fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<T, <T as FromPyObject<'a, 'py>>::Error>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Source§

fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>

Converts self into an owned Python object, dropping type information.
Source§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Source§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
Source§

impl<T> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

Source§

const NAME: &'static str = T::NAME

👎Deprecated since 0.27.0: Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.
Source§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>

Returns the expected type as a possible argument for the isinstance and issubclass function. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<'py, T> FromPyObjectOwned<'py> for T
where T: for<'a> FromPyObject<'a, 'py>,

Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T

Source§

impl<T> Ungil for T
where T: Send,