+/livesplit-wrapper
git clone https://git.julia.blue/+/livesplit-wrapper
b0170e4
gh-pages
1<!DOCTYPE html >< html lang ="en ">< head >< meta charset ="utf-8 ">< meta name ="viewport "content ="width=device-width, initial-scale=1.0 ">< meta name ="generator "content ="rustdoc ">< meta name ="description "content ="A trait which indicates that a type is a `#[repr(transparent)]` wrapper around the `Inner` value. ">< meta name ="keywords "content ="rust, rustlang, rust-lang, TransparentWrapper ">< title > TransparentWrapper in bytemuck - Rust</ title >< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceSerif4-Regular.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../FiraSans-Regular.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../FiraSans-Medium.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceCodePro-Regular.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceSerif4-Bold.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceCodePro-Semibold.ttf.woff2 ">< link rel ="stylesheet "href ="../normalize.css ">< link rel ="stylesheet "href ="../rustdoc.css "id ="mainThemeStyle ">< link rel ="stylesheet "href ="../ayu.css "disabled >< link rel ="stylesheet "href ="../dark.css "disabled >< link rel ="stylesheet "href ="../light.css "id ="themeStyle ">< script id ="default-settings "></ script >< script src ="../storage.js "></ script >< script defer src ="sidebar-items.js "></ script >< script defer src ="../main.js "></ script >< noscript >< link rel ="stylesheet "href ="../noscript.css "></ noscript >< link rel ="alternate icon "type ="image/png "href ="../favicon-16x16.png ">< link rel ="alternate icon "type ="image/png "href ="../favicon-32x32.png ">< link rel ="icon "type ="image/svg+xml "href ="../favicon.svg "></ head >< body class ="rustdoc trait "> <!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--> < nav class ="mobile-topbar ">< button class ="sidebar-menu-toggle "> ☰</ button >< a class ="sidebar-logo "href ="../bytemuck/index.html ">< div class ="logo-container ">< img class ="rust-logo "src ="../rust-logo.svg "alt ="logo "></ div ></ a >< h2 class ="location "></ h2 ></ nav >< nav class ="sidebar ">< a class ="sidebar-logo "href ="../bytemuck/index.html ">< div class ="logo-container ">< img class ="rust-logo "src ="../rust-logo.svg "alt ="logo "></ div ></ a >< h2 class ="location ">< a href ="# "> TransparentWrapper</ a ></ h2 >< div class ="sidebar-elems ">< section >< div class ="block ">< h3 class ="sidebar-title ">< a href ="#provided-methods "> Provided Methods</ a ></ h3 >< ul >< li >< a href ="#method.peel "> peel</ a ></ li >< li >< a href ="#method.peel_mut "> peel_mut</ a ></ li >< li >< a href ="#method.peel_ref "> peel_ref</ a ></ li >< li >< a href ="#method.peel_slice "> peel_slice</ a ></ li >< li >< a href ="#method.peel_slice_mut "> peel_slice_mut</ a ></ li >< li >< a href ="#method.wrap "> wrap</ a ></ li >< li >< a href ="#method.wrap_mut "> wrap_mut</ a ></ li >< li >< a href ="#method.wrap_ref "> wrap_ref</ a ></ li >< li >< a href ="#method.wrap_slice "> wrap_slice</ a ></ li >< li >< a href ="#method.wrap_slice_mut "> wrap_slice_mut</ a ></ li ></ ul ></ div >< div class ="block ">< h3 class ="sidebar-title ">< a href ="#foreign-impls "> Implementations on Foreign Types</ a ></ h3 >< ul >< li >< a href ="#impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E "> Wrapping<T></ a ></ li ></ ul ></ div >< div class ="block ">< h3 class ="sidebar-title ">< a href ="#implementors "> Implementors</ a ></ h3 ></ div ></ section >< h2 class ="location ">< a href ="index.html "> In bytemuck</ a ></ h2 ></ div ></ nav >< main >< div class ="width-limiter ">< div class ="sub-container ">< a class ="sub-logo-container "href ="../bytemuck/index.html ">< img class ="rust-logo "src ="../rust-logo.svg "alt ="logo "></ a >< nav class ="sub ">< form class ="search-form ">< div class ="search-container ">< span ></ span >< input class ="search-input "name ="search "autocomplete ="off "spellcheck ="false "placeholder ="Click or press ‘S’ to search, ‘?’ for more options… "type ="search ">< div id ="help-button "title ="help "tabindex ="-1 ">< button type ="button "> ?</ button ></ div >< div id ="settings-menu "tabindex ="-1 ">< a href ="../settings.html "title ="settings ">< img width ="22 "height ="22 "alt ="Change settings "src ="../wheel.svg "></ a ></ div ></ div ></ form ></ nav ></ div >< section id ="main-content "class ="content ">< div class ="main-heading ">< h1 class ="fqn ">< span class ="in-band "> Trait< a href ="index.html "> bytemuck</ a > ::< wbr >< a class ="trait "href ="# "> TransparentWrapper</ a >< button id ="copy-path "onclick ="copy_path(this) "title ="Copy item path to clipboard ">< img src ="../clipboard.svg "width ="19 "height ="18 "alt ="Copy item path "></ button ></ span ></ h1 >< span class ="out-of-band ">< a class ="srclink "href ="../src/bytemuck/transparent.rs.html#87-247 "> source</ a > ·< a id ="toggle-all-docs "href ="javascript:void(0) "title ="collapse all docs "> [< span class ="inner "> −</ span > ]</ a ></ span ></ div >< div class ="item-decl ">< pre class ="rust trait ">< code > pub unsafe trait TransparentWrapper<Inner: ?< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > > { 2 fn< a href ="#method.wrap "class ="fnname "> wrap</ a > (s: Inner) -> Self< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 3 { ... } 4< span class ="item-spacer "></ span > fn< a href ="#method.wrap_ref "class ="fnname "> wrap_ref</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Inner) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Self { ... } 5< span class ="item-spacer "></ span > fn< a href ="#method.wrap_mut "class ="fnname "> wrap_mut</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Inner) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Self { ... } 6< span class ="item-spacer "></ span > fn< a href ="#method.wrap_slice "class ="fnname "> wrap_slice</ a > (s: &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a > ) -> &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a >< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 7 { ... } 8< span class ="item-spacer "></ span > fn< a href ="#method.wrap_slice_mut "class ="fnname "> wrap_slice_mut</ a > (s: &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a > ) -> &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a >< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 9 { ... } 10< span class ="item-spacer "></ span > fn< a href ="#method.peel "class ="fnname "> peel</ a > (s: Self) -> Inner< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 11 { ... } 12< span class ="item-spacer "></ span > fn< a href ="#method.peel_ref "class ="fnname "> peel_ref</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Self) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Inner { ... } 13< span class ="item-spacer "></ span > fn< a href ="#method.peel_mut "class ="fnname "> peel_mut</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Self) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Inner { ... } 14< span class ="item-spacer "></ span > fn< a href ="#method.peel_slice "class ="fnname "> peel_slice</ a > (s: &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a > ) -> &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a >< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 15 { ... } 16< span class ="item-spacer "></ span > fn< a href ="#method.peel_slice_mut "class ="fnname "> peel_slice_mut</ a > (s: &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a > ) -> &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a >< br > < span class ="where "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a ></ span > , 17 { ... } 18}</ code ></ pre ></ div >< details class ="rustdoc-toggle top-doc "open >< summary class ="hideme ">< span > Expand description</ span ></ summary >< div class ="docblock ">< p > A trait which indicates that a type is a< code > #[repr(transparent)]</ code > wrapper 19around the< code > Inner</ code > value.</ p > 20< p > This allows safely copy transmuting between the< code > Inner</ code > type and the 21< code > TransparentWrapper</ code > type. Functions like< code > wrap_{}</ code > convert from the inner 22type to the wrapper type and< code > peel_{}</ code > functions do the inverse conversion 23from the wrapper type to the inner type. We deliberately do not call the 24wrapper-removing methods “unwrap” because at this point that word is too 25strongly tied to the Option/ Result methods.</ p > 26< h2 id ="safety ">< a href ="#safety "> Safety</ a ></ h2 > 27< p > The safety contract of< code > TransparentWrapper</ code > is relatively simple:</ p > 28< p > For a given< code > Wrapper</ code > which implements< code > TransparentWrapper<Inner></ code > :</ p > 29< ol > 30< li > 31< p >< code > Wrapper</ code > must be a wrapper around< code > Inner</ code > with an identical data 32representations. This either means that it must be a 33< code > #[repr(transparent)]</ code > struct which contains a either a field of type 34< code > Inner</ code > (or a field of some other transparent wrapper for< code > Inner</ code > ) as 35the only non-ZST field.</ p > 36</ li > 37< li > 38< p > Any fields< em > other</ em > than the< code > Inner</ code > field must be trivially constructable 39ZSTs, for example< code > PhantomData</ code > ,< code > PhantomPinned</ code > , etc.</ p > 40</ li > 41< li > 42< p > The< code > Wrapper</ code > may not impose additional alignment requirements over 43< code > Inner</ code > .</ p > 44< ul > 45< li > Note: this is currently guaranteed by< code > repr(transparent)</ code > , but there 46have been discussions of lifting it, so it’s stated here explicitly.</ li > 47</ ul > 48</ li > 49< li > 50< p > All functions on< code > TransparentWrapper</ code > < strong > may not</ strong > be overridden.</ p > 51</ li > 52</ ol > 53< h3 id ="caveats ">< a href ="#caveats "> Caveats</ a ></ h3 > 54< p > If the wrapper imposes additional constraints upon the inner type which are 55required for safety, it’s responsible for ensuring those still hold – this 56generally requires preventing access to instances of the inner type, as 57implementing< code > TransparentWrapper<U> for T</ code > means anybody can call 58< code > T::cast_ref(any_instance_of_u)</ code > .</ p > 59< p > For example, it would be invalid to implement TransparentWrapper for< code > str</ code > 60to implement< code > TransparentWrapper</ code > around< code > [u8]</ code > because of this.</ p > 61< h2 id ="examples ">< a href ="#examples "> Examples</ a ></ h2 >< h3 id ="basic ">< a href ="#basic "> Basic</ a ></ h3 > 62< div class ="example-wrap ">< pre class ="rust rust-example-rendered ">< code >< span class ="kw "> use</ span > bytemuck::TransparentWrapper; 63 64< span class ="attribute "> #[repr(transparent)] 65</ span >< span class ="kw "> struct</ span > MyWrapper(SomeStruct); 66 67< span class ="kw "> unsafe impl</ span > TransparentWrapper<SomeStruct>< span class ="kw "> for</ span > MyWrapper {} 68 69< span class ="comment "> // interpret a reference to &SomeStruct as a &MyWrapper 70</ span >< span class ="kw "> let</ span > thing = SomeStruct::default(); 71< span class ="kw "> let</ span > inner_ref:< span class ="kw-2 "> &</ span > MyWrapper = MyWrapper::wrap_ref(< span class ="kw-2 "> &</ span > thing); 72 73< span class ="comment "> // Works with &mut too. 74</ span >< span class ="kw "> let</ span >< span class ="kw-2 "> mut</ span > mut_thing = SomeStruct::default(); 75< span class ="kw "> let</ span > inner_mut:< span class ="kw-2 "> &mut</ span > MyWrapper = MyWrapper::wrap_mut(< span class ="kw-2 "> &mut</ span > mut_thing); 76</ code ></ pre ></ div > 77< h3 id ="use-with-dynamically-sized-types ">< a href ="#use-with-dynamically-sized-types "> Use with dynamically sized types</ a ></ h3 > 78< div class ="example-wrap ">< pre class ="rust rust-example-rendered ">< code >< span class ="kw "> use</ span > bytemuck::TransparentWrapper; 79 80< span class ="attribute "> #[repr(transparent)] 81</ span >< span class ="kw "> struct</ span > Slice<T>([T]); 82 83< span class ="kw "> unsafe impl</ span > <T> TransparentWrapper<[T]>< span class ="kw "> for</ span > Slice<T> {} 84 85< span class ="kw "> let</ span > s = Slice::wrap_ref(< span class ="kw-2 "> &</ span > [< span class ="number "> 1u32</ span > ,< span class ="number "> 2</ span > ,< span class ="number "> 3</ span > ]); 86< span class ="macro "> assert_eq!</ span > (< span class ="kw-2 "> &</ span > s.< span class ="number "> 0</ span > ,< span class ="kw-2 "> &</ span > [< span class ="number "> 1</ span > ,< span class ="number "> 2</ span > ,< span class ="number "> 3</ span > ]); 87 88< span class ="kw "> let</ span >< span class ="kw-2 "> mut</ span > buf = [< span class ="number "> 1</ span > ,< span class ="number "> 2</ span > ,< span class ="number "> 3u8</ span > ]; 89< span class ="kw "> let</ span > sm = Slice::wrap_mut(< span class ="kw-2 "> &mut</ span > buf);</ code ></ pre ></ div > 90</ div ></ details >< h2 id ="provided-methods "class ="small-section-header "> Provided Methods< a href ="#provided-methods "class ="anchor "></ a ></ h2 >< div class ="methods ">< details class ="rustdoc-toggle "open >< summary >< div id ="method.wrap "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#90-98 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.wrap "class ="fnname "> wrap</ a > (s: Inner) -> Self< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert the inner type into the wrapper type.</ p > 91</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.wrap_ref "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#103-116 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.wrap_ref "class ="fnname "> wrap_ref</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Inner) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Self</ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a reference to the inner type into a reference to the wrapper 92type.</ p > 93</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.wrap_mut "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#121-134 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.wrap_mut "class ="fnname "> wrap_mut</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Inner) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Self</ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a mutable reference to the inner type into a mutable reference to 94the wrapper type.</ p > 95</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.wrap_slice "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#138-150 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.wrap_slice "class ="fnname "> wrap_slice</ a > (s: &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a > ) -> &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a >< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a slice to the inner type into a slice to the wrapper type.</ p > 96</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.wrap_slice_mut "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#155-167 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.wrap_slice_mut "class ="fnname "> wrap_slice_mut</ a > (s: &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a > ) -> &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a >< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a mutable slice to the inner type into a mutable slice to the 97wrapper type.</ p > 98</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.peel "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#171-177 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.peel "class ="fnname "> peel</ a > (s: Self) -> Inner< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert the wrapper type into the inner type.</ p > 99</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.peel_ref "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#182-195 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.peel_ref "class ="fnname "> peel_ref</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Self) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &</ a > Inner</ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a reference to the wrapper type into a reference to the inner 100type.</ p > 101</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.peel_mut "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#200-213 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.peel_mut "class ="fnname "> peel_mut</ a > (s:< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Self) ->< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.reference.html "> &mut</ a > Inner</ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a mutable reference to the wrapper type into a mutable reference 102to the inner type.</ p > 103</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.peel_slice "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#217-229 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.peel_slice "class ="fnname "> peel_slice</ a > (s: &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a > ) -> &< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a >< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a slice to the wrapped type into a slice to the inner type.</ p > 104</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="method.peel_slice_mut "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#234-246 "> source</ a >< h4 class ="code-header "> fn< a href ="#method.peel_slice_mut "class ="fnname "> peel_slice_mut</ a > (s: &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Self]</ a > ) -> &mut< a class ="primitive "href ="https://doc.rust-lang.org/nightly/core/primitive.slice.html "> [Inner]</ a >< span class ="where fmt-newline "> where< br > Self:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,< br > Inner:< a class ="trait "href ="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html "title ="trait core::marker::Sized "> Sized</ a > ,</ span ></ h4 ></ div ></ summary >< div class ="docblock ">< p > Convert a mutable slice to the wrapped type into a mutable slice to the 105inner type.</ p > 106</ div ></ details ></ div >< h2 id ="foreign-impls "class ="small-section-header "> Implementations on Foreign Types< a href ="#foreign-impls "class ="anchor "></ a ></ h2 >< section id ="impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E "class ="impl has-srclink ">< a class ="srclink rightside "href ="../src/bytemuck/transparent.rs.html#249 "> source</ a >< a href ="#impl-TransparentWrapper%3CT%3E-for-Wrapping%3CT%3E "class ="anchor "></ a >< h3 class ="code-header in-band "> impl<T>< a class ="trait "href ="trait.TransparentWrapper.html "title ="trait bytemuck::TransparentWrapper "> TransparentWrapper</ a > <T> for< a class ="struct "href ="https://doc.rust-lang.org/nightly/core/num/wrapping/struct.Wrapping.html "title ="struct core::num::wrapping::Wrapping "> Wrapping</ a > <T></ h3 ></ section >< h2 id ="implementors "class ="small-section-header "> Implementors< a href ="#implementors "class ="anchor "></ a ></ h2 >< div class ="item-list "id ="implementors-list "></ div >< script src ="../implementors/bytemuck/transparent/trait.TransparentWrapper.js "data-ignore-extern-crates ="core "async ></ script ></ section ></ div ></ main >< div id ="rustdoc-vars "data-root-path ="../ "data-current-crate ="bytemuck "data-themes ="ayu,dark,light "data-resource-suffix =""data-rustdoc-version ="1.66.0-nightly (4a1467723 2022-09-23) "></ div ></ body ></ html >