pub(crate) fn move_out_of_context<S: Storage, Q: Querier>(
    source: &mut Ctx,
) -> (Option<S>, Option<Q>) {
    let mut b = get_context_data_mut::<S, Q>(source);
    // Destroy all existing iterators which are (in contrast to the storage)
    // not reused between different instances.
    // This is also important because the iterators are pointers to Go memory which should not be stored long term
    // Paragraphs 5-7: https://golang.org/cmd/cgo/#hdr-Passing_pointers
    destroy_iterators(&mut b);
    (b.storage.take(), b.querier.take())
}
/// Returns the original storage and querier as owned instances, and closes any remaining
/// iterators. This is meant to be called when recycling the instance.
Returns the original storage and querier as owned instances, and closes any remaining
iterators. This is meant to be called when recycling the instance.
Returns the original storage and querier as owned instances and closes any remaining iterators . This is meant to be called when recycling the instance .
pub(crate) fn move_out_of_context<S: Storage, Q: Querier>(
    source: &mut Ctx,
) -> (Option<S>, Option<Q>) {
    let mut b = get_context_data_mut::<S, Q>(source);
    // Destroy all existing iterators which are (in contrast to the storage)
    // not reused between different instances.
    // This is also important because the iterators are pointers to Go memory which should not be stored long term
    // Paragraphs 5-7: https://golang.org/cmd/cgo/#hdr-Passing_pointers
    destroy_iterators(&mut b);
    (b.storage.take(), b.querier.take())
}
pub ( crate ) fn move_out_of_context < S : Storage , Q : Querier > ( source : & mut Ctx , ) -> ( Option < S > , Option < Q > ) { let mut b = get_context_data_mut :: < S , Q > ( source ) ; // Destroy all existing iterators which are (in contrast to the storage) // not reused between different instances. // This is also important because the iterators are pointers to Go memory which should not be stored long term // Paragraphs 5-7: https://golang.org/cmd/cgo/#hdr-Passing_pointers destroy_iterators ( & mut b ) ; ( b . storage . take ( ) , b . querier . take ( ) ) }
Returns the original storage and querier as owned instances, and closes any remaining
iterators.
Returns the original storage and querier as owned instances and closes any remaining iterators .
source
&mut Ctx
source
&mut Ctx