diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 847ec625..33d4361d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,7 +9,7 @@ on: env: CARGO_TERM_COLOR: always - MOST_FEATURES: all-extensions cursor image tracing tracing-subscriber/env-filter + MOST_FEATURES: all-extensions cursor extra-traits image tracing tracing-subscriber/env-filter # According to code coverage changes, sometimes $XENVIRONMENT is set and # sometimes not. Try to make this consistent to stabilise coverage reports. # Example: https://app.codecov.io/gh/psychon/x11rb/compare/726/changes @@ -60,6 +60,12 @@ jobs: - name: clippy x11rb without features run: cargo clippy -p x11rb --all-targets -- -D warnings ${{ matrix.clippy_args }} + - name: clippy x11rb without default features + run: cargo clippy -p x11rb --all-targets -- -D warnings ${{ matrix.clippy_args }} --no-default-features + + - name: clippy x11rb-protocol with request parsing + run: cargo clippy -p x11rb-protocol --all-targets -- -D warnings ${{ matrix.clippy_args }} --features request-parsing + - name: clippy x11rb with allow-unsafe-code but without dl-libxcb run: cargo clippy -p x11rb --all-targets --features "allow-unsafe-code" -- -D warnings ${{ matrix.clippy_args }} diff --git a/generator/src/generator/namespace/request.rs b/generator/src/generator/namespace/request.rs index 26e22fc4..72392e20 100644 --- a/generator/src/generator/namespace/request.rs +++ b/generator/src/generator/namespace/request.rs @@ -951,7 +951,7 @@ fn emit_request_struct( ); outln!( out, - "#[cfg(feature = \"extra-traits\")]" + "#[cfg(feature = \"request-parsing\")]" ); if gathered.has_fds() { outln!( diff --git a/generator/src/generator/namespace/switch.rs b/generator/src/generator/namespace/switch.rs index db70fa24..70a458d5 100644 --- a/generator/src/generator/namespace/switch.rs +++ b/generator/src/generator/namespace/switch.rs @@ -396,6 +396,10 @@ fn emit_switch_try_parse( ) }) .collect::>(); + outln!( + out.indent(), + "#[cfg_attr(not(feature = \"request-parsing\"), allow(dead_code))]" + ); outln!( out.indent(), "fn try_parse(value: &[u8], {}) -> Result<(Self, &[u8]), ParseError> {{", diff --git a/generator/src/generator/requests_replies.rs b/generator/src/generator/requests_replies.rs index 99a2d6e7..c433739c 100644 --- a/generator/src/generator/requests_replies.rs +++ b/generator/src/generator/requests_replies.rs @@ -203,7 +203,7 @@ pub(super) fn generate(out: &mut Output, module: &xcbdefs::Module, mut enum_case out, "#[allow(clippy::cognitive_complexity, clippy::single_match)]" ); - outln!(out, "#[cfg(feature = \"extra-traits\")]"); + outln!(out, "#[cfg(feature = \"request-parsing\")]"); outln!(out, "pub fn parse("); out.indented(|out| { outln!(out, "header: RequestHeader,"); diff --git a/x11rb-async/Cargo.toml b/x11rb-async/Cargo.toml index 276bc4d1..e324bc07 100644 --- a/x11rb-async/Cargo.toml +++ b/x11rb-async/Cargo.toml @@ -58,6 +58,7 @@ all-extensions = [ "xvmc" ] +# Enable extra traits on protocol types. extra-traits = ["x11rb-protocol/extra-traits"] composite = ["x11rb-protocol/composite", "xfixes"] diff --git a/x11rb-protocol/Cargo.toml b/x11rb-protocol/Cargo.toml index 4670627b..c9dcf0c5 100644 --- a/x11rb-protocol/Cargo.toml +++ b/x11rb-protocol/Cargo.toml @@ -27,6 +27,11 @@ std = [] # Enable extra traits for the X11 types extra-traits = [] +# Enable parsing for requests. +# +# This adds a lot of extra code that isn't used in the common case. +request-parsing = [] + # Enable utility functions in `x11rb::resource_manager` for querying the # resource databases. resource_manager = ["std"] diff --git a/x11rb-protocol/src/protocol/bigreq.rs b/x11rb-protocol/src/protocol/bigreq.rs index 7c90815f..92cae1ae 100644 --- a/x11rb-protocol/src/protocol/bigreq.rs +++ b/x11rb-protocol/src/protocol/bigreq.rs @@ -69,7 +69,7 @@ impl EnableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ENABLE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/composite.rs b/x11rb-protocol/src/protocol/composite.rs index e3517289..08451e63 100644 --- a/x11rb-protocol/src/protocol/composite.rs +++ b/x11rb-protocol/src/protocol/composite.rs @@ -148,7 +148,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -333,7 +333,7 @@ impl RedirectWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != REDIRECT_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -417,7 +417,7 @@ impl RedirectSubwindowsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != REDIRECT_SUBWINDOWS_REQUEST { return Err(ParseError::InvalidValue); @@ -499,7 +499,7 @@ impl UnredirectWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNREDIRECT_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -581,7 +581,7 @@ impl UnredirectSubwindowsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNREDIRECT_SUBWINDOWS_REQUEST { return Err(ParseError::InvalidValue); @@ -652,7 +652,7 @@ impl CreateRegionFromBorderClipRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REGION_FROM_BORDER_CLIP_REQUEST { return Err(ParseError::InvalidValue); @@ -721,7 +721,7 @@ impl NameWindowPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != NAME_WINDOW_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -784,7 +784,7 @@ impl GetOverlayWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_OVERLAY_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -933,7 +933,7 @@ impl ReleaseOverlayWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != RELEASE_OVERLAY_WINDOW_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/damage.rs b/x11rb-protocol/src/protocol/damage.rs index 3385cfaa..6f759d59 100644 --- a/x11rb-protocol/src/protocol/damage.rs +++ b/x11rb-protocol/src/protocol/damage.rs @@ -158,7 +158,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -367,7 +367,7 @@ impl CreateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REQUEST { return Err(ParseError::InvalidValue); @@ -442,7 +442,7 @@ impl DestroyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_REQUEST { return Err(ParseError::InvalidValue); @@ -524,7 +524,7 @@ impl SubtractRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SUBTRACT_REQUEST { return Err(ParseError::InvalidValue); @@ -604,7 +604,7 @@ impl AddRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ADD_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/dbe.rs b/x11rb-protocol/src/protocol/dbe.rs index 82593f81..8d7346e5 100644 --- a/x11rb-protocol/src/protocol/dbe.rs +++ b/x11rb-protocol/src/protocol/dbe.rs @@ -340,7 +340,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -517,7 +517,7 @@ impl AllocateBackBufferRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ALLOCATE_BACK_BUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -590,7 +590,7 @@ impl DeallocateBackBufferRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DEALLOCATE_BACK_BUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -663,7 +663,7 @@ impl<'input> SwapBuffersRequest<'input> { ([request0.into(), actions_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SWAP_BUFFERS_REQUEST { return Err(ParseError::InvalidValue); @@ -727,7 +727,7 @@ impl BeginIdiomRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != BEGIN_IDIOM_REQUEST { return Err(ParseError::InvalidValue); @@ -780,7 +780,7 @@ impl EndIdiomRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != END_IDIOM_REQUEST { return Err(ParseError::InvalidValue); @@ -845,7 +845,7 @@ impl<'input> GetVisualInfoRequest<'input> { ([request0.into(), drawables_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GET_VISUAL_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -992,7 +992,7 @@ impl GetBackBufferAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_BACK_BUFFER_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/dpms.rs b/x11rb-protocol/src/protocol/dpms.rs index 60bfed16..559da294 100644 --- a/x11rb-protocol/src/protocol/dpms.rs +++ b/x11rb-protocol/src/protocol/dpms.rs @@ -74,7 +74,7 @@ impl GetVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -200,7 +200,7 @@ impl CapableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CAPABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -340,7 +340,7 @@ impl GetTimeoutsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TIMEOUTS_REQUEST { return Err(ParseError::InvalidValue); @@ -503,7 +503,7 @@ impl SetTimeoutsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_TIMEOUTS_REQUEST { return Err(ParseError::InvalidValue); @@ -561,7 +561,7 @@ impl EnableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ENABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -613,7 +613,7 @@ impl DisableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DISABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -729,7 +729,7 @@ impl ForceLevelRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FORCE_LEVEL_REQUEST { return Err(ParseError::InvalidValue); @@ -784,7 +784,7 @@ impl InfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -982,7 +982,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/dri2.rs b/x11rb-protocol/src/protocol/dri2.rs index 1a30e82e..29a7168b 100644 --- a/x11rb-protocol/src/protocol/dri2.rs +++ b/x11rb-protocol/src/protocol/dri2.rs @@ -359,7 +359,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -502,7 +502,7 @@ impl ConnectRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CONNECT_REQUEST { return Err(ParseError::InvalidValue); @@ -669,7 +669,7 @@ impl AuthenticateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != AUTHENTICATE_REQUEST { return Err(ParseError::InvalidValue); @@ -798,7 +798,7 @@ impl CreateDrawableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_DRAWABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -859,7 +859,7 @@ impl DestroyDrawableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_DRAWABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -931,7 +931,7 @@ impl<'input> GetBuffersRequest<'input> { ([request0.into(), attachments_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GET_BUFFERS_REQUEST { return Err(ParseError::InvalidValue); @@ -1106,7 +1106,7 @@ impl CopyRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COPY_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -1242,7 +1242,7 @@ impl<'input> GetBuffersWithFormatRequest<'input> { ([request0.into(), attachments_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GET_BUFFERS_WITH_FORMAT_REQUEST { return Err(ParseError::InvalidValue); @@ -1435,7 +1435,7 @@ impl SwapBuffersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SWAP_BUFFERS_REQUEST { return Err(ParseError::InvalidValue); @@ -1582,7 +1582,7 @@ impl GetMSCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MSC_REQUEST { return Err(ParseError::InvalidValue); @@ -1785,7 +1785,7 @@ impl WaitMSCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != WAIT_MSC_REQUEST { return Err(ParseError::InvalidValue); @@ -1976,7 +1976,7 @@ impl WaitSBCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != WAIT_SBC_REQUEST { return Err(ParseError::InvalidValue); @@ -2153,7 +2153,7 @@ impl SwapIntervalRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SWAP_INTERVAL_REQUEST { return Err(ParseError::InvalidValue); @@ -2222,7 +2222,7 @@ impl GetParamRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PARAM_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/dri3.rs b/x11rb-protocol/src/protocol/dri3.rs index c23cc885..e72f7769 100644 --- a/x11rb-protocol/src/protocol/dri3.rs +++ b/x11rb-protocol/src/protocol/dri3.rs @@ -78,7 +78,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -221,7 +221,7 @@ impl OpenRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != OPEN_REQUEST { return Err(ParseError::InvalidValue); @@ -400,7 +400,7 @@ impl PixmapFromBufferRequest { ([request0.into()], vec![self.pixmap_fd]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request_fd(header: RequestHeader, value: &[u8], fds: &mut Vec) -> Result { if header.minor_opcode != PIXMAP_FROM_BUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -478,7 +478,7 @@ impl BufferFromPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != BUFFER_FROM_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -661,7 +661,7 @@ impl FenceFromFDRequest { ([request0.into()], vec![self.fence_fd]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request_fd(header: RequestHeader, value: &[u8], fds: &mut Vec) -> Result { if header.minor_opcode != FENCE_FROM_FD_REQUEST { return Err(ParseError::InvalidValue); @@ -736,7 +736,7 @@ impl FDFromFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FD_FROM_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -894,7 +894,7 @@ impl GetSupportedModifiersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SUPPORTED_MODIFIERS_REQUEST { return Err(ParseError::InvalidValue); @@ -1135,7 +1135,7 @@ impl PixmapFromBuffersRequest { ([request0.into()], self.buffers) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request_fd(header: RequestHeader, value: &[u8], fds: &mut Vec) -> Result { if header.minor_opcode != PIXMAP_FROM_BUFFERS_REQUEST { return Err(ParseError::InvalidValue); @@ -1232,7 +1232,7 @@ impl BuffersFromPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != BUFFERS_FROM_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -1399,7 +1399,7 @@ impl SetDRMDeviceInUseRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_DRM_DEVICE_IN_USE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/ge.rs b/x11rb-protocol/src/protocol/ge.rs index 42890098..1a32b3e3 100644 --- a/x11rb-protocol/src/protocol/ge.rs +++ b/x11rb-protocol/src/protocol/ge.rs @@ -72,7 +72,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/glx.rs b/x11rb-protocol/src/protocol/glx.rs index b01ade03..8c00664f 100644 --- a/x11rb-protocol/src/protocol/glx.rs +++ b/x11rb-protocol/src/protocol/glx.rs @@ -576,7 +576,7 @@ impl<'input> RenderRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != RENDER_REQUEST { return Err(ParseError::InvalidValue); @@ -664,7 +664,7 @@ impl<'input> RenderLargeRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != RENDER_LARGE_REQUEST { return Err(ParseError::InvalidValue); @@ -765,7 +765,7 @@ impl CreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -835,7 +835,7 @@ impl DestroyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -908,7 +908,7 @@ impl MakeCurrentRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != MAKE_CURRENT_REQUEST { return Err(ParseError::InvalidValue); @@ -1061,7 +1061,7 @@ impl IsDirectRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_DIRECT_REQUEST { return Err(ParseError::InvalidValue); @@ -1216,7 +1216,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -1371,7 +1371,7 @@ impl WaitGLRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != WAIT_GL_REQUEST { return Err(ParseError::InvalidValue); @@ -1432,7 +1432,7 @@ impl WaitXRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != WAIT_X_REQUEST { return Err(ParseError::InvalidValue); @@ -1511,7 +1511,7 @@ impl CopyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COPY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1669,7 +1669,7 @@ impl SwapBuffersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SWAP_BUFFERS_REQUEST { return Err(ParseError::InvalidValue); @@ -1756,7 +1756,7 @@ impl UseXFontRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != USE_X_FONT_REQUEST { return Err(ParseError::InvalidValue); @@ -1843,7 +1843,7 @@ impl CreateGLXPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_GLX_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -1910,7 +1910,7 @@ impl GetVisualConfigsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VISUAL_CONFIGS_REQUEST { return Err(ParseError::InvalidValue); @@ -2045,7 +2045,7 @@ impl DestroyGLXPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_GLX_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -2116,7 +2116,7 @@ impl<'input> VendorPrivateRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != VENDOR_PRIVATE_REQUEST { return Err(ParseError::InvalidValue); @@ -2199,7 +2199,7 @@ impl<'input> VendorPrivateWithReplyRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != VENDOR_PRIVATE_WITH_REPLY_REQUEST { return Err(ParseError::InvalidValue); @@ -2347,7 +2347,7 @@ impl QueryExtensionsStringRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_EXTENSIONS_STRING_REQUEST { return Err(ParseError::InvalidValue); @@ -2504,7 +2504,7 @@ impl QueryServerStringRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_SERVER_STRING_REQUEST { return Err(ParseError::InvalidValue); @@ -2657,7 +2657,7 @@ impl<'input> ClientInfoRequest<'input> { ([request0.into(), self.string, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CLIENT_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -2731,7 +2731,7 @@ impl GetFBConfigsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_FB_CONFIGS_REQUEST { return Err(ParseError::InvalidValue); @@ -2896,7 +2896,7 @@ impl<'input> CreatePixmapRequest<'input> { ([request0.into(), attribs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -2976,7 +2976,7 @@ impl DestroyPixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -3067,7 +3067,7 @@ impl CreateNewContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_NEW_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -3139,7 +3139,7 @@ impl QueryContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -3291,7 +3291,7 @@ impl MakeContextCurrentRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != MAKE_CONTEXT_CURRENT_REQUEST { return Err(ParseError::InvalidValue); @@ -3470,7 +3470,7 @@ impl<'input> CreatePbufferRequest<'input> { ([request0.into(), attribs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_PBUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -3547,7 +3547,7 @@ impl DestroyPbufferRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_PBUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -3608,7 +3608,7 @@ impl GetDrawableAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DRAWABLE_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -3754,7 +3754,7 @@ impl<'input> ChangeDrawableAttributesRequest<'input> { ([request0.into(), attribs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_DRAWABLE_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -3855,7 +3855,7 @@ impl<'input> CreateWindowRequest<'input> { ([request0.into(), attribs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -3935,7 +3935,7 @@ impl DeleteWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -4032,7 +4032,7 @@ impl<'input> SetClientInfoARBRequest<'input> { ([request0.into(), gl_versions_bytes.into(), self.gl_extension_string, padding0.into(), self.glx_extension_string, padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CLIENT_INFO_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -4154,7 +4154,7 @@ impl<'input> CreateContextAttribsARBRequest<'input> { ([request0.into(), attribs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_ATTRIBS_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -4274,7 +4274,7 @@ impl<'input> SetClientInfo2ARBRequest<'input> { ([request0.into(), gl_versions_bytes.into(), self.gl_extension_string, padding0.into(), self.glx_extension_string, padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CLIENT_INFO2_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -4372,7 +4372,7 @@ impl NewListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != NEW_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -4437,7 +4437,7 @@ impl EndListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != END_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -4510,7 +4510,7 @@ impl DeleteListsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_LISTS_REQUEST { return Err(ParseError::InvalidValue); @@ -4581,7 +4581,7 @@ impl GenListsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GEN_LISTS_REQUEST { return Err(ParseError::InvalidValue); @@ -4722,7 +4722,7 @@ impl FeedbackBufferRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FEEDBACK_BUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -4793,7 +4793,7 @@ impl SelectBufferRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_BUFFER_REQUEST { return Err(ParseError::InvalidValue); @@ -4862,7 +4862,7 @@ impl RenderModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != RENDER_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -5057,7 +5057,7 @@ impl FinishRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FINISH_REQUEST { return Err(ParseError::InvalidValue); @@ -5188,7 +5188,7 @@ impl PixelStorefRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PIXEL_STOREF_REQUEST { return Err(ParseError::InvalidValue); @@ -5265,7 +5265,7 @@ impl PixelStoreiRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PIXEL_STOREI_REQUEST { return Err(ParseError::InvalidValue); @@ -5374,7 +5374,7 @@ impl ReadPixelsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != READ_PIXELS_REQUEST { return Err(ParseError::InvalidValue); @@ -5528,7 +5528,7 @@ impl GetBooleanvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_BOOLEANV_REQUEST { return Err(ParseError::InvalidValue); @@ -5673,7 +5673,7 @@ impl GetClipPlaneRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CLIP_PLANE_REQUEST { return Err(ParseError::InvalidValue); @@ -5811,7 +5811,7 @@ impl GetDoublevRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DOUBLEV_REQUEST { return Err(ParseError::InvalidValue); @@ -5950,7 +5950,7 @@ impl GetErrorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_ERROR_REQUEST { return Err(ParseError::InvalidValue); @@ -6083,7 +6083,7 @@ impl GetFloatvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_FLOATV_REQUEST { return Err(ParseError::InvalidValue); @@ -6228,7 +6228,7 @@ impl GetIntegervRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_INTEGERV_REQUEST { return Err(ParseError::InvalidValue); @@ -6379,7 +6379,7 @@ impl GetLightfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_LIGHTFV_REQUEST { return Err(ParseError::InvalidValue); @@ -6532,7 +6532,7 @@ impl GetLightivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_LIGHTIV_REQUEST { return Err(ParseError::InvalidValue); @@ -6685,7 +6685,7 @@ impl GetMapdvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MAPDV_REQUEST { return Err(ParseError::InvalidValue); @@ -6838,7 +6838,7 @@ impl GetMapfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MAPFV_REQUEST { return Err(ParseError::InvalidValue); @@ -6991,7 +6991,7 @@ impl GetMapivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MAPIV_REQUEST { return Err(ParseError::InvalidValue); @@ -7144,7 +7144,7 @@ impl GetMaterialfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MATERIALFV_REQUEST { return Err(ParseError::InvalidValue); @@ -7297,7 +7297,7 @@ impl GetMaterialivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MATERIALIV_REQUEST { return Err(ParseError::InvalidValue); @@ -7444,7 +7444,7 @@ impl GetPixelMapfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PIXEL_MAPFV_REQUEST { return Err(ParseError::InvalidValue); @@ -7589,7 +7589,7 @@ impl GetPixelMapuivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PIXEL_MAPUIV_REQUEST { return Err(ParseError::InvalidValue); @@ -7734,7 +7734,7 @@ impl GetPixelMapusvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PIXEL_MAPUSV_REQUEST { return Err(ParseError::InvalidValue); @@ -7879,7 +7879,7 @@ impl GetPolygonStippleRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_POLYGON_STIPPLE_REQUEST { return Err(ParseError::InvalidValue); @@ -8019,7 +8019,7 @@ impl GetStringRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_STRING_REQUEST { return Err(ParseError::InvalidValue); @@ -8168,7 +8168,7 @@ impl GetTexEnvfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_ENVFV_REQUEST { return Err(ParseError::InvalidValue); @@ -8321,7 +8321,7 @@ impl GetTexEnvivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_ENVIV_REQUEST { return Err(ParseError::InvalidValue); @@ -8474,7 +8474,7 @@ impl GetTexGendvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_GENDV_REQUEST { return Err(ParseError::InvalidValue); @@ -8627,7 +8627,7 @@ impl GetTexGenfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_GENFV_REQUEST { return Err(ParseError::InvalidValue); @@ -8780,7 +8780,7 @@ impl GetTexGenivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_GENIV_REQUEST { return Err(ParseError::InvalidValue); @@ -8951,7 +8951,7 @@ impl GetTexImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -9116,7 +9116,7 @@ impl GetTexParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -9269,7 +9269,7 @@ impl GetTexParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -9428,7 +9428,7 @@ impl GetTexLevelParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_LEVEL_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -9589,7 +9589,7 @@ impl GetTexLevelParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_TEX_LEVEL_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -9738,7 +9738,7 @@ impl IsEnabledRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_ENABLED_REQUEST { return Err(ParseError::InvalidValue); @@ -9873,7 +9873,7 @@ impl IsListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -10002,7 +10002,7 @@ impl FlushRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FLUSH_REQUEST { return Err(ParseError::InvalidValue); @@ -10074,7 +10074,7 @@ impl<'input> AreTexturesResidentRequest<'input> { ([request0.into(), textures_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != ARE_TEXTURES_RESIDENT_REQUEST { return Err(ParseError::InvalidValue); @@ -10229,7 +10229,7 @@ impl<'input> DeleteTexturesRequest<'input> { ([request0.into(), textures_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != DELETE_TEXTURES_REQUEST { return Err(ParseError::InvalidValue); @@ -10306,7 +10306,7 @@ impl GenTexturesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GEN_TEXTURES_REQUEST { return Err(ParseError::InvalidValue); @@ -10443,7 +10443,7 @@ impl IsTextureRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_TEXTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -10596,7 +10596,7 @@ impl GetColorTableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_COLOR_TABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -10753,7 +10753,7 @@ impl GetColorTableParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_COLOR_TABLE_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -10906,7 +10906,7 @@ impl GetColorTableParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_COLOR_TABLE_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -11071,7 +11071,7 @@ impl GetConvolutionFilterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CONVOLUTION_FILTER_REQUEST { return Err(ParseError::InvalidValue); @@ -11231,7 +11231,7 @@ impl GetConvolutionParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CONVOLUTION_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -11384,7 +11384,7 @@ impl GetConvolutionParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CONVOLUTION_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -11549,7 +11549,7 @@ impl GetSeparableFilterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SEPARABLE_FILTER_REQUEST { return Err(ParseError::InvalidValue); @@ -11723,7 +11723,7 @@ impl GetHistogramRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_HISTOGRAM_REQUEST { return Err(ParseError::InvalidValue); @@ -11882,7 +11882,7 @@ impl GetHistogramParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_HISTOGRAM_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -12035,7 +12035,7 @@ impl GetHistogramParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_HISTOGRAM_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -12202,7 +12202,7 @@ impl GetMinmaxRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MINMAX_REQUEST { return Err(ParseError::InvalidValue); @@ -12356,7 +12356,7 @@ impl GetMinmaxParameterfvRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MINMAX_PARAMETERFV_REQUEST { return Err(ParseError::InvalidValue); @@ -12509,7 +12509,7 @@ impl GetMinmaxParameterivRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MINMAX_PARAMETERIV_REQUEST { return Err(ParseError::InvalidValue); @@ -12662,7 +12662,7 @@ impl GetCompressedTexImageARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_COMPRESSED_TEX_IMAGE_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -12814,7 +12814,7 @@ impl<'input> DeleteQueriesARBRequest<'input> { ([request0.into(), ids_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != DELETE_QUERIES_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -12891,7 +12891,7 @@ impl GenQueriesARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GEN_QUERIES_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -13028,7 +13028,7 @@ impl IsQueryARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_QUERY_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -13169,7 +13169,7 @@ impl GetQueryivARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_QUERYIV_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -13322,7 +13322,7 @@ impl GetQueryObjectivARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_QUERY_OBJECTIV_ARB_REQUEST { return Err(ParseError::InvalidValue); @@ -13475,7 +13475,7 @@ impl GetQueryObjectuivARBRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_QUERY_OBJECTUIV_ARB_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/mod.rs b/x11rb-protocol/src/protocol/mod.rs index 081d2241..8c4c0345 100644 --- a/x11rb-protocol/src/protocol/mod.rs +++ b/x11rb-protocol/src/protocol/mod.rs @@ -2217,7 +2217,7 @@ pub enum Request<'input> { impl<'input> Request<'input> { // Parse a X11 request into a concrete type #[allow(clippy::cognitive_complexity, clippy::single_match)] - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn parse( header: RequestHeader, body: &'input [u8], diff --git a/x11rb-protocol/src/protocol/present.rs b/x11rb-protocol/src/protocol/present.rs index fc099554..0fbefbee 100644 --- a/x11rb-protocol/src/protocol/present.rs +++ b/x11rb-protocol/src/protocol/present.rs @@ -501,7 +501,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -733,7 +733,7 @@ impl<'input> PixmapRequest<'input> { ([request0.into(), notifies_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -890,7 +890,7 @@ impl NotifyMSCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != NOTIFY_MSC_REQUEST { return Err(ParseError::InvalidValue); @@ -974,7 +974,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -1040,7 +1040,7 @@ impl QueryCapabilitiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_CAPABILITIES_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/randr.rs b/x11rb-protocol/src/protocol/randr.rs index 91a31786..2f88f538 100644 --- a/x11rb-protocol/src/protocol/randr.rs +++ b/x11rb-protocol/src/protocol/randr.rs @@ -265,7 +265,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -509,7 +509,7 @@ impl SetScreenConfigRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_SCREEN_CONFIG_REQUEST { return Err(ParseError::InvalidValue); @@ -758,7 +758,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -823,7 +823,7 @@ impl GetScreenInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -983,7 +983,7 @@ impl GetScreenSizeRangeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_SIZE_RANGE_REQUEST { return Err(ParseError::InvalidValue); @@ -1164,7 +1164,7 @@ impl SetScreenSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_SCREEN_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -1418,7 +1418,7 @@ impl GetScreenResourcesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_RESOURCES_REQUEST { return Err(ParseError::InvalidValue); @@ -1681,7 +1681,7 @@ impl GetOutputInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_OUTPUT_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -1896,7 +1896,7 @@ impl ListOutputPropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_OUTPUT_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -2034,7 +2034,7 @@ impl QueryOutputPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_OUTPUT_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -2193,7 +2193,7 @@ impl<'input> ConfigureOutputPropertyRequest<'input> { ([request0.into(), values_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CONFIGURE_OUTPUT_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -2311,7 +2311,7 @@ impl<'input> ChangeOutputPropertyRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_OUTPUT_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -2404,7 +2404,7 @@ impl DeleteOutputPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_OUTPUT_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -2499,7 +2499,7 @@ impl GetOutputPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_OUTPUT_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -2676,7 +2676,7 @@ impl<'input> CreateModeRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -2837,7 +2837,7 @@ impl DestroyModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -2904,7 +2904,7 @@ impl AddOutputModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ADD_OUTPUT_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -2973,7 +2973,7 @@ impl DeleteOutputModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_OUTPUT_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -3042,7 +3042,7 @@ impl GetCrtcInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CRTC_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -3258,7 +3258,7 @@ impl<'input> SetCrtcConfigRequest<'input> { ([request0.into(), outputs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CRTC_CONFIG_REQUEST { return Err(ParseError::InvalidValue); @@ -3446,7 +3446,7 @@ impl GetCrtcGammaSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CRTC_GAMMA_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -3595,7 +3595,7 @@ impl GetCrtcGammaRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CRTC_GAMMA_REQUEST { return Err(ParseError::InvalidValue); @@ -3754,7 +3754,7 @@ impl<'input> SetCrtcGammaRequest<'input> { ([request0.into(), red_bytes.into(), green_bytes.into(), blue_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CRTC_GAMMA_REQUEST { return Err(ParseError::InvalidValue); @@ -3832,7 +3832,7 @@ impl GetScreenResourcesCurrentRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_RESOURCES_CURRENT_REQUEST { return Err(ParseError::InvalidValue); @@ -4145,7 +4145,7 @@ impl<'input> SetCrtcTransformRequest<'input> { ([request0.into(), self.filter_name, padding0.into(), filter_params_bytes.into(), padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CRTC_TRANSFORM_REQUEST { return Err(ParseError::InvalidValue); @@ -4234,7 +4234,7 @@ impl GetCrtcTransformRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CRTC_TRANSFORM_REQUEST { return Err(ParseError::InvalidValue); @@ -4447,7 +4447,7 @@ impl GetPanningRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PANNING_REQUEST { return Err(ParseError::InvalidValue); @@ -4703,7 +4703,7 @@ impl SetPanningRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PANNING_REQUEST { return Err(ParseError::InvalidValue); @@ -4865,7 +4865,7 @@ impl SetOutputPrimaryRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_OUTPUT_PRIMARY_REQUEST { return Err(ParseError::InvalidValue); @@ -4928,7 +4928,7 @@ impl GetOutputPrimaryRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_OUTPUT_PRIMARY_REQUEST { return Err(ParseError::InvalidValue); @@ -5055,7 +5055,7 @@ impl GetProvidersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROVIDERS_REQUEST { return Err(ParseError::InvalidValue); @@ -5248,7 +5248,7 @@ impl GetProviderInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROVIDER_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -5464,7 +5464,7 @@ impl SetProviderOffloadSinkRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PROVIDER_OFFLOAD_SINK_REQUEST { return Err(ParseError::InvalidValue); @@ -5541,7 +5541,7 @@ impl SetProviderOutputSourceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PROVIDER_OUTPUT_SOURCE_REQUEST { return Err(ParseError::InvalidValue); @@ -5606,7 +5606,7 @@ impl ListProviderPropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_PROVIDER_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -5744,7 +5744,7 @@ impl QueryProviderPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_PROVIDER_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -5903,7 +5903,7 @@ impl<'input> ConfigureProviderPropertyRequest<'input> { ([request0.into(), values_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CONFIGURE_PROVIDER_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -6021,7 +6021,7 @@ impl<'input> ChangeProviderPropertyRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_PROVIDER_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -6113,7 +6113,7 @@ impl DeleteProviderPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_PROVIDER_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -6208,7 +6208,7 @@ impl GetProviderPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROVIDER_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -7158,7 +7158,7 @@ impl GetMonitorsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MONITORS_REQUEST { return Err(ParseError::InvalidValue); @@ -7303,7 +7303,7 @@ impl SetMonitorRequest { ([request0.into(), monitorinfo_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_MONITOR_REQUEST { return Err(ParseError::InvalidValue); @@ -7372,7 +7372,7 @@ impl DeleteMonitorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_MONITOR_REQUEST { return Err(ParseError::InvalidValue); @@ -7457,7 +7457,7 @@ impl<'input> CreateLeaseRequest<'input> { ([request0.into(), crtcs_bytes.into(), outputs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_LEASE_REQUEST { return Err(ParseError::InvalidValue); @@ -7628,7 +7628,7 @@ impl FreeLeaseRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FREE_LEASE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/record.rs b/x11rb-protocol/src/protocol/record.rs index 47fd8247..12ebb2ca 100644 --- a/x11rb-protocol/src/protocol/record.rs +++ b/x11rb-protocol/src/protocol/record.rs @@ -465,7 +465,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -624,7 +624,7 @@ impl<'input> CreateContextRequest<'input> { ([request0.into(), client_specs_bytes.into(), ranges_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -729,7 +729,7 @@ impl<'input> RegisterClientsRequest<'input> { ([request0.into(), client_specs_bytes.into(), ranges_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != REGISTER_CLIENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -819,7 +819,7 @@ impl<'input> UnregisterClientsRequest<'input> { ([request0.into(), client_specs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != UNREGISTER_CLIENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -890,7 +890,7 @@ impl GetContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1028,7 +1028,7 @@ impl EnableContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ENABLE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1178,7 +1178,7 @@ impl DisableContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DISABLE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1239,7 +1239,7 @@ impl FreeContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FREE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/render.rs b/x11rb-protocol/src/protocol/render.rs index 75730e01..cfc49f48 100644 --- a/x11rb-protocol/src/protocol/render.rs +++ b/x11rb-protocol/src/protocol/render.rs @@ -1379,7 +1379,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -1527,7 +1527,7 @@ impl QueryPictFormatsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_PICT_FORMATS_REQUEST { return Err(ParseError::InvalidValue); @@ -1711,7 +1711,7 @@ impl QueryPictIndexValuesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_PICT_INDEX_VALUES_REQUEST { return Err(ParseError::InvalidValue); @@ -1833,6 +1833,7 @@ impl core::fmt::Debug for CreatePictureAux { } } impl CreatePictureAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -2187,7 +2188,7 @@ impl<'input> CreatePictureRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_PICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -2254,6 +2255,7 @@ impl core::fmt::Debug for ChangePictureAux { } } impl ChangePictureAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -2596,7 +2598,7 @@ impl<'input> ChangePictureRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_PICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -2680,7 +2682,7 @@ impl<'input> SetPictureClipRectanglesRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_PICTURE_CLIP_RECTANGLES_REQUEST { return Err(ParseError::InvalidValue); @@ -2763,7 +2765,7 @@ impl FreePictureRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FREE_PICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -2874,7 +2876,7 @@ impl CompositeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COMPOSITE_REQUEST { return Err(ParseError::InvalidValue); @@ -2990,7 +2992,7 @@ impl<'input> TrapezoidsRequest<'input> { ([request0.into(), traps_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != TRAPEZOIDS_REQUEST { return Err(ParseError::InvalidValue); @@ -3115,7 +3117,7 @@ impl<'input> TrianglesRequest<'input> { ([request0.into(), triangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != TRIANGLES_REQUEST { return Err(ParseError::InvalidValue); @@ -3240,7 +3242,7 @@ impl<'input> TriStripRequest<'input> { ([request0.into(), points_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != TRI_STRIP_REQUEST { return Err(ParseError::InvalidValue); @@ -3365,7 +3367,7 @@ impl<'input> TriFanRequest<'input> { ([request0.into(), points_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != TRI_FAN_REQUEST { return Err(ParseError::InvalidValue); @@ -3465,7 +3467,7 @@ impl CreateGlyphSetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_GLYPH_SET_REQUEST { return Err(ParseError::InvalidValue); @@ -3534,7 +3536,7 @@ impl ReferenceGlyphSetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != REFERENCE_GLYPH_SET_REQUEST { return Err(ParseError::InvalidValue); @@ -3597,7 +3599,7 @@ impl FreeGlyphSetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FREE_GLYPH_SET_REQUEST { return Err(ParseError::InvalidValue); @@ -3675,7 +3677,7 @@ impl<'input> AddGlyphsRequest<'input> { ([request0.into(), glyphids_bytes.into(), glyphs_bytes.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != ADD_GLYPHS_REQUEST { return Err(ParseError::InvalidValue); @@ -3757,7 +3759,7 @@ impl<'input> FreeGlyphsRequest<'input> { ([request0.into(), glyphs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != FREE_GLYPHS_REQUEST { return Err(ParseError::InvalidValue); @@ -3870,7 +3872,7 @@ impl<'input> CompositeGlyphs8Request<'input> { ([request0.into(), self.glyphcmds, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != COMPOSITE_GLYPHS8_REQUEST { return Err(ParseError::InvalidValue); @@ -3996,7 +3998,7 @@ impl<'input> CompositeGlyphs16Request<'input> { ([request0.into(), self.glyphcmds, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != COMPOSITE_GLYPHS16_REQUEST { return Err(ParseError::InvalidValue); @@ -4122,7 +4124,7 @@ impl<'input> CompositeGlyphs32Request<'input> { ([request0.into(), self.glyphcmds, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != COMPOSITE_GLYPHS32_REQUEST { return Err(ParseError::InvalidValue); @@ -4233,7 +4235,7 @@ impl<'input> FillRectanglesRequest<'input> { ([request0.into(), rects_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != FILL_RECTANGLES_REQUEST { return Err(ParseError::InvalidValue); @@ -4332,7 +4334,7 @@ impl CreateCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -4537,7 +4539,7 @@ impl SetPictureTransformRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PICTURE_TRANSFORM_REQUEST { return Err(ParseError::InvalidValue); @@ -4600,7 +4602,7 @@ impl QueryFiltersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_FILTERS_REQUEST { return Err(ParseError::InvalidValue); @@ -4766,7 +4768,7 @@ impl<'input> SetPictureFilterRequest<'input> { ([request0.into(), self.filter, padding0.into(), values_bytes.into(), padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_PICTURE_FILTER_REQUEST { return Err(ParseError::InvalidValue); @@ -4901,7 +4903,7 @@ impl<'input> CreateAnimCursorRequest<'input> { ([request0.into(), cursors_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_ANIM_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -5103,7 +5105,7 @@ impl<'input> AddTrapsRequest<'input> { ([request0.into(), traps_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != ADD_TRAPS_REQUEST { return Err(ParseError::InvalidValue); @@ -5196,7 +5198,7 @@ impl CreateSolidFillRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_SOLID_FILL_REQUEST { return Err(ParseError::InvalidValue); @@ -5294,7 +5296,7 @@ impl<'input> CreateLinearGradientRequest<'input> { ([request0.into(), stops_bytes.into(), colors_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_LINEAR_GRADIENT_REQUEST { return Err(ParseError::InvalidValue); @@ -5421,7 +5423,7 @@ impl<'input> CreateRadialGradientRequest<'input> { ([request0.into(), stops_bytes.into(), colors_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_RADIAL_GRADIENT_REQUEST { return Err(ParseError::InvalidValue); @@ -5538,7 +5540,7 @@ impl<'input> CreateConicalGradientRequest<'input> { ([request0.into(), stops_bytes.into(), colors_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_CONICAL_GRADIENT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/res.rs b/x11rb-protocol/src/protocol/res.rs index 470c926a..41279e00 100644 --- a/x11rb-protocol/src/protocol/res.rs +++ b/x11rb-protocol/src/protocol/res.rs @@ -470,7 +470,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -596,7 +596,7 @@ impl QueryClientsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_CLIENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -726,7 +726,7 @@ impl QueryClientResourcesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_CLIENT_RESOURCES_REQUEST { return Err(ParseError::InvalidValue); @@ -858,7 +858,7 @@ impl QueryClientPixmapBytesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_CLIENT_PIXMAP_BYTES_REQUEST { return Err(ParseError::InvalidValue); @@ -998,7 +998,7 @@ impl<'input> QueryClientIdsRequest<'input> { ([request0.into(), specs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != QUERY_CLIENT_IDS_REQUEST { return Err(ParseError::InvalidValue); @@ -1148,7 +1148,7 @@ impl<'input> QueryResourceBytesRequest<'input> { ([request0.into(), specs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != QUERY_RESOURCE_BYTES_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/screensaver.rs b/x11rb-protocol/src/protocol/screensaver.rs index 75d68a59..b4ded323 100644 --- a/x11rb-protocol/src/protocol/screensaver.rs +++ b/x11rb-protocol/src/protocol/screensaver.rs @@ -246,7 +246,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -402,7 +402,7 @@ impl QueryInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -576,7 +576,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -632,6 +632,7 @@ impl core::fmt::Debug for SetAttributesAux { } } impl SetAttributesAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -1047,7 +1048,7 @@ impl<'input> SetAttributesRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -1143,7 +1144,7 @@ impl UnsetAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNSET_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -1204,7 +1205,7 @@ impl SuspendRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SUSPEND_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/shape.rs b/x11rb-protocol/src/protocol/shape.rs index 58ee0338..8f3badff 100644 --- a/x11rb-protocol/src/protocol/shape.rs +++ b/x11rb-protocol/src/protocol/shape.rs @@ -357,7 +357,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -509,7 +509,7 @@ impl<'input> RectanglesRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != RECTANGLES_REQUEST { return Err(ParseError::InvalidValue); @@ -627,7 +627,7 @@ impl MaskRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != MASK_REQUEST { return Err(ParseError::InvalidValue); @@ -725,7 +725,7 @@ impl CombineRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COMBINE_REQUEST { return Err(ParseError::InvalidValue); @@ -816,7 +816,7 @@ impl OffsetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != OFFSET_REQUEST { return Err(ParseError::InvalidValue); @@ -885,7 +885,7 @@ impl QueryExtentsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_EXTENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -1072,7 +1072,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -1136,7 +1136,7 @@ impl InputSelectedRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != INPUT_SELECTED_REQUEST { return Err(ParseError::InvalidValue); @@ -1263,7 +1263,7 @@ impl GetRectanglesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_RECTANGLES_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/shm.rs b/x11rb-protocol/src/protocol/shm.rs index 34a4379a..4ce58e07 100644 --- a/x11rb-protocol/src/protocol/shm.rs +++ b/x11rb-protocol/src/protocol/shm.rs @@ -225,7 +225,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -432,7 +432,7 @@ impl AttachRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ATTACH_REQUEST { return Err(ParseError::InvalidValue); @@ -506,7 +506,7 @@ impl DetachRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DETACH_REQUEST { return Err(ParseError::InvalidValue); @@ -658,7 +658,7 @@ impl PutImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PUT_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -805,7 +805,7 @@ impl GetImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -1015,7 +1015,7 @@ impl CreatePixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -1105,7 +1105,7 @@ impl AttachFdRequest { ([request0.into()], vec![self.shm_fd]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request_fd(header: RequestHeader, value: &[u8], fds: &mut Vec) -> Result { if header.minor_opcode != ATTACH_FD_REQUEST { return Err(ParseError::InvalidValue); @@ -1194,7 +1194,7 @@ impl CreateSegmentRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_SEGMENT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/sync.rs b/x11rb-protocol/src/protocol/sync.rs index b9b53b0b..6f9d2fb5 100644 --- a/x11rb-protocol/src/protocol/sync.rs +++ b/x11rb-protocol/src/protocol/sync.rs @@ -538,7 +538,7 @@ impl InitializeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != INITIALIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -686,7 +686,7 @@ impl ListSystemCountersRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_SYSTEM_COUNTERS_REQUEST { return Err(ParseError::InvalidValue); @@ -826,7 +826,7 @@ impl CreateCounterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_COUNTER_REQUEST { return Err(ParseError::InvalidValue); @@ -889,7 +889,7 @@ impl DestroyCounterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_COUNTER_REQUEST { return Err(ParseError::InvalidValue); @@ -950,7 +950,7 @@ impl QueryCounterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_COUNTER_REQUEST { return Err(ParseError::InvalidValue); @@ -1080,7 +1080,7 @@ impl<'input> AwaitRequest<'input> { ([request0.into(), wait_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != AWAIT_REQUEST { return Err(ParseError::InvalidValue); @@ -1164,7 +1164,7 @@ impl ChangeCounterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_COUNTER_REQUEST { return Err(ParseError::InvalidValue); @@ -1237,7 +1237,7 @@ impl SetCounterRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_COUNTER_REQUEST { return Err(ParseError::InvalidValue); @@ -1283,6 +1283,7 @@ impl core::fmt::Debug for CreateAlarmAux { } } impl CreateAlarmAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -1483,7 +1484,7 @@ impl<'input> CreateAlarmRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_ALARM_REQUEST { return Err(ParseError::InvalidValue); @@ -1537,6 +1538,7 @@ impl core::fmt::Debug for ChangeAlarmAux { } } impl ChangeAlarmAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -1737,7 +1739,7 @@ impl<'input> ChangeAlarmRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_ALARM_REQUEST { return Err(ParseError::InvalidValue); @@ -1808,7 +1810,7 @@ impl DestroyAlarmRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_ALARM_REQUEST { return Err(ParseError::InvalidValue); @@ -1869,7 +1871,7 @@ impl QueryAlarmRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_ALARM_REQUEST { return Err(ParseError::InvalidValue); @@ -2045,7 +2047,7 @@ impl SetPriorityRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PRIORITY_REQUEST { return Err(ParseError::InvalidValue); @@ -2108,7 +2110,7 @@ impl GetPriorityRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PRIORITY_REQUEST { return Err(ParseError::InvalidValue); @@ -2247,7 +2249,7 @@ impl CreateFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -2312,7 +2314,7 @@ impl TriggerFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != TRIGGER_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -2373,7 +2375,7 @@ impl ResetFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != RESET_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -2434,7 +2436,7 @@ impl DestroyFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -2495,7 +2497,7 @@ impl QueryFenceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_FENCE_REQUEST { return Err(ParseError::InvalidValue); @@ -2643,7 +2645,7 @@ impl<'input> AwaitFenceRequest<'input> { ([request0.into(), fence_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != AWAIT_FENCE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xc_misc.rs b/x11rb-protocol/src/protocol/xc_misc.rs index fe035700..baa2c242 100644 --- a/x11rb-protocol/src/protocol/xc_misc.rs +++ b/x11rb-protocol/src/protocol/xc_misc.rs @@ -72,7 +72,7 @@ impl GetVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -198,7 +198,7 @@ impl GetXIDRangeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_XID_RANGE_REQUEST { return Err(ParseError::InvalidValue); @@ -331,7 +331,7 @@ impl GetXIDListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_XID_LIST_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xevie.rs b/x11rb-protocol/src/protocol/xevie.rs index 61081975..0c200aaf 100644 --- a/x11rb-protocol/src/protocol/xevie.rs +++ b/x11rb-protocol/src/protocol/xevie.rs @@ -72,7 +72,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -227,7 +227,7 @@ impl StartRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != START_REQUEST { return Err(ParseError::InvalidValue); @@ -372,7 +372,7 @@ impl EndRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != END_REQUEST { return Err(ParseError::InvalidValue); @@ -748,7 +748,7 @@ impl SendRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SEND_REQUEST { return Err(ParseError::InvalidValue); @@ -896,7 +896,7 @@ impl SelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xf86dri.rs b/x11rb-protocol/src/protocol/xf86dri.rs index 504fec85..5f0ece36 100644 --- a/x11rb-protocol/src/protocol/xf86dri.rs +++ b/x11rb-protocol/src/protocol/xf86dri.rs @@ -115,7 +115,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -252,7 +252,7 @@ impl QueryDirectRenderingCapableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_DIRECT_RENDERING_CAPABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -376,7 +376,7 @@ impl OpenConnectionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != OPEN_CONNECTION_REQUEST { return Err(ParseError::InvalidValue); @@ -515,7 +515,7 @@ impl CloseConnectionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CLOSE_CONNECTION_REQUEST { return Err(ParseError::InvalidValue); @@ -576,7 +576,7 @@ impl GetClientDriverNameRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CLIENT_DRIVER_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -730,7 +730,7 @@ impl CreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -867,7 +867,7 @@ impl DestroyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -936,7 +936,7 @@ impl CreateDrawableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_DRAWABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -1071,7 +1071,7 @@ impl DestroyDrawableRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_DRAWABLE_REQUEST { return Err(ParseError::InvalidValue); @@ -1140,7 +1140,7 @@ impl GetDrawableInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DRAWABLE_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -1315,7 +1315,7 @@ impl GetDeviceInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -1466,7 +1466,7 @@ impl AuthConnectionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != AUTH_CONNECTION_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xf86vidmode.rs b/x11rb-protocol/src/protocol/xf86vidmode.rs index b8a9443a..c2291d53 100644 --- a/x11rb-protocol/src/protocol/xf86vidmode.rs +++ b/x11rb-protocol/src/protocol/xf86vidmode.rs @@ -360,7 +360,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -489,7 +489,7 @@ impl GetModeLineRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MODE_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -725,7 +725,7 @@ impl<'input> ModModeLineRequest<'input> { ([request0.into(), self.private, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != MOD_MODE_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -831,7 +831,7 @@ impl SwitchModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SWITCH_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -894,7 +894,7 @@ impl GetMonitorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MONITOR_REQUEST { return Err(ParseError::InvalidValue); @@ -1093,7 +1093,7 @@ impl LockModeSwitchRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LOCK_MODE_SWITCH_REQUEST { return Err(ParseError::InvalidValue); @@ -1156,7 +1156,7 @@ impl GetAllModeLinesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_ALL_MODE_LINES_REQUEST { return Err(ParseError::InvalidValue); @@ -1423,7 +1423,7 @@ impl<'input> AddModeLineRequest<'input> { ([request0.into(), self.private, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != ADD_MODE_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -1638,7 +1638,7 @@ impl<'input> DeleteModeLineRequest<'input> { ([request0.into(), self.private, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != DELETE_MODE_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -1817,7 +1817,7 @@ impl<'input> ValidateModeLineRequest<'input> { ([request0.into(), self.private, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != VALIDATE_MODE_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -2084,7 +2084,7 @@ impl<'input> SwitchToModeRequest<'input> { ([request0.into(), self.private, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SWITCH_TO_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -2191,7 +2191,7 @@ impl GetViewPortRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VIEW_PORT_REQUEST { return Err(ParseError::InvalidValue); @@ -2357,7 +2357,7 @@ impl SetViewPortRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_VIEW_PORT_REQUEST { return Err(ParseError::InvalidValue); @@ -2423,7 +2423,7 @@ impl GetDotClocksRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DOT_CLOCKS_REQUEST { return Err(ParseError::InvalidValue); @@ -2551,7 +2551,7 @@ impl SetClientVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_CLIENT_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -2644,7 +2644,7 @@ impl SetGammaRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_GAMMA_REQUEST { return Err(ParseError::InvalidValue); @@ -2737,7 +2737,7 @@ impl GetGammaRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_GAMMA_REQUEST { return Err(ParseError::InvalidValue); @@ -2897,7 +2897,7 @@ impl GetGammaRampRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_GAMMA_RAMP_REQUEST { return Err(ParseError::InvalidValue); @@ -3041,7 +3041,7 @@ impl<'input> SetGammaRampRequest<'input> { ([request0.into(), red_bytes.into(), green_bytes.into(), blue_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_GAMMA_RAMP_REQUEST { return Err(ParseError::InvalidValue); @@ -3120,7 +3120,7 @@ impl GetGammaRampSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_GAMMA_RAMP_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -3270,7 +3270,7 @@ impl GetPermissionsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PERMISSIONS_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xfixes.rs b/x11rb-protocol/src/protocol/xfixes.rs index 0fae3d24..4989116e 100644 --- a/x11rb-protocol/src/protocol/xfixes.rs +++ b/x11rb-protocol/src/protocol/xfixes.rs @@ -82,7 +82,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -424,7 +424,7 @@ impl ChangeSaveSetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_SAVE_SET_REQUEST { return Err(ParseError::InvalidValue); @@ -770,7 +770,7 @@ impl SelectSelectionInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_SELECTION_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -1092,7 +1092,7 @@ impl SelectCursorInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_CURSOR_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -1149,7 +1149,7 @@ impl GetCursorImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CURSOR_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -1350,7 +1350,7 @@ impl<'input> CreateRegionRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -1433,7 +1433,7 @@ impl CreateRegionFromBitmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REGION_FROM_BITMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -1508,7 +1508,7 @@ impl CreateRegionFromWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REGION_FROM_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -1581,7 +1581,7 @@ impl CreateRegionFromGCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REGION_FROM_GC_REQUEST { return Err(ParseError::InvalidValue); @@ -1650,7 +1650,7 @@ impl CreateRegionFromPictureRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_REGION_FROM_PICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -1713,7 +1713,7 @@ impl DestroyRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -1779,7 +1779,7 @@ impl<'input> SetRegionRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -1862,7 +1862,7 @@ impl CopyRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COPY_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -1937,7 +1937,7 @@ impl UnionRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNION_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2014,7 +2014,7 @@ impl IntersectRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != INTERSECT_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2091,7 +2091,7 @@ impl SubtractRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SUBTRACT_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2172,7 +2172,7 @@ impl InvertRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != INVERT_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2245,7 +2245,7 @@ impl TranslateRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != TRANSLATE_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2316,7 +2316,7 @@ impl RegionExtentsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != REGION_EXTENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -2379,7 +2379,7 @@ impl FetchRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FETCH_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2526,7 +2526,7 @@ impl SetGCClipRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_GC_CLIP_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2613,7 +2613,7 @@ impl SetWindowShapeRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_WINDOW_SHAPE_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2698,7 +2698,7 @@ impl SetPictureClipRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PICTURE_CLIP_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -2775,7 +2775,7 @@ impl<'input> SetCursorNameRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CURSOR_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -2847,7 +2847,7 @@ impl GetCursorNameRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CURSOR_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -2976,7 +2976,7 @@ impl GetCursorImageAndNameRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CURSOR_IMAGE_AND_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -3141,7 +3141,7 @@ impl ChangeCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -3214,7 +3214,7 @@ impl<'input> ChangeCursorByNameRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_CURSOR_BY_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -3308,7 +3308,7 @@ impl ExpandRegionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != EXPAND_REGION_REQUEST { return Err(ParseError::InvalidValue); @@ -3379,7 +3379,7 @@ impl HideCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != HIDE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -3440,7 +3440,7 @@ impl ShowCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SHOW_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -3594,7 +3594,7 @@ impl<'input> CreatePointerBarrierRequest<'input> { ([request0.into(), devices_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_POINTER_BARRIER_REQUEST { return Err(ParseError::InvalidValue); @@ -3685,7 +3685,7 @@ impl DeletePointerBarrierRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_POINTER_BARRIER_REQUEST { return Err(ParseError::InvalidValue); @@ -3807,7 +3807,7 @@ impl SetClientDisconnectModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_CLIENT_DISCONNECT_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -3862,7 +3862,7 @@ impl GetClientDisconnectModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CLIENT_DISCONNECT_MODE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xinerama.rs b/x11rb-protocol/src/protocol/xinerama.rs index be1ab8c5..b7e9aaa9 100644 --- a/x11rb-protocol/src/protocol/xinerama.rs +++ b/x11rb-protocol/src/protocol/xinerama.rs @@ -126,7 +126,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -259,7 +259,7 @@ impl GetStateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_STATE_REQUEST { return Err(ParseError::InvalidValue); @@ -388,7 +388,7 @@ impl GetScreenCountRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_COUNT_REQUEST { return Err(ParseError::InvalidValue); @@ -523,7 +523,7 @@ impl GetScreenSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SCREEN_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -669,7 +669,7 @@ impl IsActiveRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != IS_ACTIVE_REQUEST { return Err(ParseError::InvalidValue); @@ -787,7 +787,7 @@ impl QueryScreensRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_SCREENS_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xinput.rs b/x11rb-protocol/src/protocol/xinput.rs index 89e106e7..1bd371be 100644 --- a/x11rb-protocol/src/protocol/xinput.rs +++ b/x11rb-protocol/src/protocol/xinput.rs @@ -130,7 +130,7 @@ impl<'input> GetExtensionVersionRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GET_EXTENSION_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -889,6 +889,7 @@ impl core::fmt::Debug for InputInfoInfo { } } impl InputInfoInfo { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], class_id: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(class_id); let mut outer_remaining = value; @@ -1083,7 +1084,7 @@ impl ListInputDevicesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_INPUT_DEVICES_REQUEST { return Err(ParseError::InvalidValue); @@ -1269,7 +1270,7 @@ impl OpenDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != OPEN_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -1409,7 +1410,7 @@ impl CloseDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CLOSE_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -1473,7 +1474,7 @@ impl SetDeviceModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_DEVICE_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -1640,7 +1641,7 @@ impl<'input> SelectExtensionEventRequest<'input> { ([request0.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SELECT_EXTENSION_EVENT_REQUEST { return Err(ParseError::InvalidValue); @@ -1712,7 +1713,7 @@ impl GetSelectedExtensionEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SELECTED_EXTENSION_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -1936,7 +1937,7 @@ impl<'input> ChangeDeviceDontPropagateListRequest<'input> { ([request0.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_DEVICE_DONT_PROPAGATE_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -2012,7 +2013,7 @@ impl GetDeviceDontPropagateListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_DONT_PROPAGATE_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -2192,7 +2193,7 @@ impl GetDeviceMotionEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_MOTION_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -2346,7 +2347,7 @@ impl ChangeKeyboardDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_KEYBOARD_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -2503,7 +2504,7 @@ impl ChangePointerDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_POINTER_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -2689,7 +2690,7 @@ impl<'input> GrabDeviceRequest<'input> { ([request0.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -2875,7 +2876,7 @@ impl UngrabDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNGRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -3029,7 +3030,7 @@ impl<'input> GrabDeviceKeyRequest<'input> { ([request0.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GRAB_DEVICE_KEY_REQUEST { return Err(ParseError::InvalidValue); @@ -3141,7 +3142,7 @@ impl UngrabDeviceKeyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNGRAB_DEVICE_KEY_REQUEST { return Err(ParseError::InvalidValue); @@ -3244,7 +3245,7 @@ impl<'input> GrabDeviceButtonRequest<'input> { ([request0.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != GRAB_DEVICE_BUTTON_REQUEST { return Err(ParseError::InvalidValue); @@ -3356,7 +3357,7 @@ impl UngrabDeviceButtonRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNGRAB_DEVICE_BUTTON_REQUEST { return Err(ParseError::InvalidValue); @@ -3502,7 +3503,7 @@ impl AllowDeviceEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != ALLOW_DEVICE_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -3569,7 +3570,7 @@ impl GetDeviceFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -3744,7 +3745,7 @@ impl SetDeviceFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_DEVICE_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -4676,6 +4677,7 @@ impl core::fmt::Debug for FeedbackStateData { } } impl FeedbackStateData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], class_id: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(class_id); let mut outer_remaining = value; @@ -4871,7 +4873,7 @@ impl GetFeedbackControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_FEEDBACK_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -5701,6 +5703,7 @@ impl core::fmt::Debug for FeedbackCtlData { } } impl FeedbackCtlData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], class_id: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(class_id); let mut outer_remaining = value; @@ -5979,7 +5982,7 @@ impl ChangeFeedbackControlRequest { ([request0.into(), feedback_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_FEEDBACK_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -6052,7 +6055,7 @@ impl GetDeviceKeyMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_KEY_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -6202,7 +6205,7 @@ impl<'input> ChangeDeviceKeyMappingRequest<'input> { ([request0.into(), keysyms_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_DEVICE_KEY_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -6281,7 +6284,7 @@ impl GetDeviceModifierMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_MODIFIER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -6425,7 +6428,7 @@ impl<'input> SetDeviceModifierMappingRequest<'input> { ([request0.into(), self.keymaps, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_MODIFIER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -6588,7 +6591,7 @@ impl GetDeviceButtonMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_BUTTON_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -6735,7 +6738,7 @@ impl<'input> SetDeviceButtonMappingRequest<'input> { ([request0.into(), self.map, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_BUTTON_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -7364,6 +7367,7 @@ impl core::fmt::Debug for InputStateData { } } impl InputStateData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], class_id: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(class_id); let mut outer_remaining = value; @@ -7514,7 +7518,7 @@ impl QueryDeviceStateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_DEVICE_STATE_REQUEST { return Err(ParseError::InvalidValue); @@ -7654,7 +7658,7 @@ impl DeviceBellRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DEVICE_BELL_REQUEST { return Err(ParseError::InvalidValue); @@ -7730,7 +7734,7 @@ impl<'input> SetDeviceValuatorsRequest<'input> { ([request0.into(), valuators_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_VALUATORS_REQUEST { return Err(ParseError::InvalidValue); @@ -8573,6 +8577,7 @@ impl core::fmt::Debug for DeviceStateData { } } impl DeviceStateData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], control_id: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(control_id); let mut outer_remaining = value; @@ -8759,7 +8764,7 @@ impl GetDeviceControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -9486,6 +9491,7 @@ impl core::fmt::Debug for DeviceCtlData { } } impl DeviceCtlData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], control_id: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(control_id); let mut outer_remaining = value; @@ -9677,7 +9683,7 @@ impl ChangeDeviceControlRequest { ([request0.into(), control_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CHANGE_DEVICE_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -9834,7 +9840,7 @@ impl ListDevicePropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_DEVICE_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -10017,6 +10023,7 @@ impl core::fmt::Debug for ChangeDevicePropertyAux { } } impl ChangeDevicePropertyAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], format: u8, num_items: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(format); let mut outer_remaining = value; @@ -10181,7 +10188,7 @@ impl<'input> ChangeDevicePropertyRequest<'input> { ([request0.into(), items_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CHANGE_DEVICE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -10272,7 +10279,7 @@ impl DeleteDevicePropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DELETE_DEVICE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -10362,7 +10369,7 @@ impl GetDevicePropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -10423,6 +10430,7 @@ impl core::fmt::Debug for GetDevicePropertyItems { } } impl GetDevicePropertyItems { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], format: u8, num_items: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(format); let mut outer_remaining = value; @@ -10813,7 +10821,7 @@ impl XIQueryPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_QUERY_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -11019,7 +11027,7 @@ impl XIWarpPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_WARP_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -11109,7 +11117,7 @@ impl XIChangeCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_CHANGE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -11714,6 +11722,7 @@ impl core::fmt::Debug for HierarchyChangeData { } } impl HierarchyChangeData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], type_: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(type_); let mut outer_remaining = value; @@ -11883,7 +11892,7 @@ impl<'input> XIChangeHierarchyRequest<'input> { ([request0.into(), changes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_CHANGE_HIERARCHY_REQUEST { return Err(ParseError::InvalidValue); @@ -11958,7 +11967,7 @@ impl XISetClientPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_SET_CLIENT_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -12022,7 +12031,7 @@ impl XIGetClientPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_GET_CLIENT_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -12347,7 +12356,7 @@ impl<'input> XISelectEventsRequest<'input> { ([request0.into(), masks_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_SELECT_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -12421,7 +12430,7 @@ impl XIQueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -13619,6 +13628,7 @@ impl core::fmt::Debug for DeviceClassData { } } impl DeviceClassData { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], type_: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(type_); let mut outer_remaining = value; @@ -13910,7 +13920,7 @@ impl XIQueryDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_QUERY_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -14055,7 +14065,7 @@ impl XISetFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_SET_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -14121,7 +14131,7 @@ impl XIGetFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_GET_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -14377,7 +14387,7 @@ impl<'input> XIGrabDeviceRequest<'input> { ([request0.into(), mask_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_GRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -14565,7 +14575,7 @@ impl XIUngrabDeviceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_UNGRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -14720,7 +14730,7 @@ impl XIAllowEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_ALLOW_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -15066,7 +15076,7 @@ impl<'input> XIPassiveGrabDeviceRequest<'input> { ([request0.into(), mask_bytes.into(), modifiers_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_PASSIVE_GRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -15266,7 +15276,7 @@ impl<'input> XIPassiveUngrabDeviceRequest<'input> { ([request0.into(), modifiers_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_PASSIVE_UNGRAB_DEVICE_REQUEST { return Err(ParseError::InvalidValue); @@ -15348,7 +15358,7 @@ impl XIListPropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_LIST_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -15469,6 +15479,7 @@ impl core::fmt::Debug for XIChangePropertyAux { } } impl XIChangePropertyAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], format: u8, num_items: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(format); let mut outer_remaining = value; @@ -15633,7 +15644,7 @@ impl<'input> XIChangePropertyRequest<'input> { ([request0.into(), items_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_CHANGE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -15723,7 +15734,7 @@ impl XIDeletePropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_DELETE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -15813,7 +15824,7 @@ impl XIGetPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_GET_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -15874,6 +15885,7 @@ impl core::fmt::Debug for XIGetPropertyItems { } } impl XIGetPropertyItems { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], format: u8, num_items: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u8::from(format); let mut outer_remaining = value; @@ -16075,7 +16087,7 @@ impl XIGetSelectedEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != XI_GET_SELECTED_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -16266,7 +16278,7 @@ impl<'input> XIBarrierReleasePointerRequest<'input> { ([request0.into(), barriers_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != XI_BARRIER_RELEASE_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -20978,7 +20990,7 @@ impl<'input> SendExtensionEventRequest<'input> { ([request0.into(), events_bytes.into(), classes_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SEND_EXTENSION_EVENT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xkb.rs b/x11rb-protocol/src/protocol/xkb.rs index eb32d817..84e0dabf 100644 --- a/x11rb-protocol/src/protocol/xkb.rs +++ b/x11rb-protocol/src/protocol/xkb.rs @@ -6161,7 +6161,7 @@ impl UseExtensionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != USE_EXTENSION_REQUEST { return Err(ParseError::InvalidValue); @@ -6755,6 +6755,7 @@ impl core::fmt::Debug for SelectEventsAux { } } impl SelectEventsAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], affect_which: u16, clear: u16, select_all: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(affect_which) & ((!u16::from(clear)) & (!u16::from(select_all))); let mut outer_remaining = value; @@ -7054,7 +7055,7 @@ impl<'input> SelectEventsRequest<'input> { ([request0.into(), details_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SELECT_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -7179,7 +7180,7 @@ impl BellRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != BELL_REQUEST { return Err(ParseError::InvalidValue); @@ -7260,7 +7261,7 @@ impl GetStateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_STATE_REQUEST { return Err(ParseError::InvalidValue); @@ -7500,7 +7501,7 @@ impl LatchLockStateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LATCH_LOCK_STATE_REQUEST { return Err(ParseError::InvalidValue); @@ -7581,7 +7582,7 @@ impl GetControlsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CONTROLS_REQUEST { return Err(ParseError::InvalidValue); @@ -8024,7 +8025,7 @@ impl<'input> SetControlsRequest<'input> { ([request0.into(), Cow::Owned(self.per_key_repeat.to_vec())], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_CONTROLS_REQUEST { return Err(ParseError::InvalidValue); @@ -8249,7 +8250,7 @@ impl GetMapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -8375,6 +8376,7 @@ impl core::fmt::Debug for GetMapMap { } } impl GetMapMap { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], present: u16, n_types: u8, n_key_syms: u8, n_key_actions: u8, total_actions: u16, total_key_behaviors: u8, virtual_mods: u16, total_key_explicit: u8, total_mod_map_keys: u8, total_v_mod_map_keys: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(present); let mut outer_remaining = value; @@ -8740,6 +8742,7 @@ impl core::fmt::Debug for SetMapAux { } } impl SetMapAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], present: u16, n_types: u8, n_key_syms: u8, n_key_actions: u8, total_actions: u16, total_key_behaviors: u8, virtual_mods: u16, total_key_explicit: u8, total_mod_map_keys: u8, total_v_mod_map_keys: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(present); let mut outer_remaining = value; @@ -9063,7 +9066,7 @@ impl<'input> SetMapRequest<'input> { ([request0.into(), values_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -9220,7 +9223,7 @@ impl GetCompatMapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_COMPAT_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -9405,7 +9408,7 @@ impl<'input> SetCompatMapRequest<'input> { ([request0.into(), si_bytes.into(), group_maps_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_COMPAT_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -9494,7 +9497,7 @@ impl GetIndicatorStateRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_INDICATOR_STATE_REQUEST { return Err(ParseError::InvalidValue); @@ -9652,7 +9655,7 @@ impl GetIndicatorMapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_INDICATOR_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -9792,7 +9795,7 @@ impl<'input> SetIndicatorMapRequest<'input> { ([request0.into(), maps_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_INDICATOR_MAP_REQUEST { return Err(ParseError::InvalidValue); @@ -9880,7 +9883,7 @@ impl GetNamedIndicatorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_NAMED_INDICATOR_REQUEST { return Err(ParseError::InvalidValue); @@ -10151,7 +10154,7 @@ impl SetNamedIndicatorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_NAMED_INDICATOR_REQUEST { return Err(ParseError::InvalidValue); @@ -10256,7 +10259,7 @@ impl GetNamesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_NAMES_REQUEST { return Err(ParseError::InvalidValue); @@ -10354,6 +10357,7 @@ impl core::fmt::Debug for GetNamesValueList { } } impl GetNamesValueList { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], which: u32, n_types: u8, indicators: u32, virtual_mods: u16, group_names: u8, n_keys: u8, n_key_aliases: u8, n_radio_groups: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(which); let mut outer_remaining = value; @@ -10741,6 +10745,7 @@ impl core::fmt::Debug for SetNamesAux { } } impl SetNamesAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], which: u32, n_types: u8, indicators: u32, virtual_mods: u16, group_names: u8, n_keys: u8, n_key_aliases: u8, n_radio_groups: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(which); let mut outer_remaining = value; @@ -11145,7 +11150,7 @@ impl<'input> SetNamesRequest<'input> { ([request0.into(), values_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_NAMES_REQUEST { return Err(ParseError::InvalidValue); @@ -11285,7 +11290,7 @@ impl PerClientFlagsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PER_CLIENT_FLAGS_REQUEST { return Err(ParseError::InvalidValue); @@ -11470,7 +11475,7 @@ impl ListComponentsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_COMPONENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -11713,7 +11718,7 @@ impl GetKbdByNameRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_KBD_BY_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -11810,6 +11815,7 @@ impl core::fmt::Debug for GetKbdByNameRepliesTypesMap { } } impl GetKbdByNameRepliesTypesMap { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], present: u16, n_types: u8, n_key_syms: u8, n_key_actions: u8, total_actions: u16, total_key_behaviors: u8, virtual_mods: u16, total_key_explicit: u8, total_mod_map_keys: u8, total_v_mod_map_keys: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(present); let mut outer_remaining = value; @@ -12320,6 +12326,7 @@ impl core::fmt::Debug for GetKbdByNameRepliesKeyNamesValueList { } } impl GetKbdByNameRepliesKeyNamesValueList { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], which: u32, n_types: u8, indicators: u32, virtual_mods: u16, group_names: u8, n_keys: u8, n_key_aliases: u8, n_radio_groups: u8) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(which); let mut outer_remaining = value; @@ -12728,6 +12735,7 @@ impl core::fmt::Debug for GetKbdByNameReplies { } } impl GetKbdByNameReplies { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], reported: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(reported); let mut outer_remaining = value; @@ -12926,7 +12934,7 @@ impl GetDeviceInfoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -13175,7 +13183,7 @@ impl<'input> SetDeviceInfoRequest<'input> { ([request0.into(), btn_actions_bytes.into(), leds_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -13285,7 +13293,7 @@ impl<'input> SetDebuggingFlagsRequest<'input> { ([request0.into(), self.message, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEBUGGING_FLAGS_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xprint.rs b/x11rb-protocol/src/protocol/xprint.rs index d2f97a0a..ec41a51f 100644 --- a/x11rb-protocol/src/protocol/xprint.rs +++ b/x11rb-protocol/src/protocol/xprint.rs @@ -419,7 +419,7 @@ impl PrintQueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -562,7 +562,7 @@ impl<'input> PrintGetPrinterListRequest<'input> { ([request0.into(), self.printer_name, padding0.into(), self.locale, padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PRINT_GET_PRINTER_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -702,7 +702,7 @@ impl PrintRehashPrinterListRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_REHASH_PRINTER_LIST_REQUEST { return Err(ParseError::InvalidValue); @@ -781,7 +781,7 @@ impl<'input> CreateContextRequest<'input> { ([request0.into(), self.printer_name, padding0.into(), self.locale, padding1.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -860,7 +860,7 @@ impl PrintSetContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_SET_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -914,7 +914,7 @@ impl PrintGetContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1039,7 +1039,7 @@ impl PrintDestroyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_DESTROY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1093,7 +1093,7 @@ impl PrintGetScreenOfContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_SCREEN_OF_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1218,7 +1218,7 @@ impl PrintStartJobRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_START_JOB_REQUEST { return Err(ParseError::InvalidValue); @@ -1279,7 +1279,7 @@ impl PrintEndJobRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_END_JOB_REQUEST { return Err(ParseError::InvalidValue); @@ -1340,7 +1340,7 @@ impl PrintStartDocRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_START_DOC_REQUEST { return Err(ParseError::InvalidValue); @@ -1401,7 +1401,7 @@ impl PrintEndDocRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_END_DOC_REQUEST { return Err(ParseError::InvalidValue); @@ -1488,7 +1488,7 @@ impl<'input> PrintPutDocumentDataRequest<'input> { ([request0.into(), self.data, padding0.into(), self.doc_format, padding1.into(), self.options, padding2.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PRINT_PUT_DOCUMENT_DATA_REQUEST { return Err(ParseError::InvalidValue); @@ -1581,7 +1581,7 @@ impl PrintGetDocumentDataRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_DOCUMENT_DATA_REQUEST { return Err(ParseError::InvalidValue); @@ -1722,7 +1722,7 @@ impl PrintStartPageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_START_PAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -1783,7 +1783,7 @@ impl PrintEndPageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_END_PAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -1851,7 +1851,7 @@ impl PrintSelectInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_SELECT_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -1914,7 +1914,7 @@ impl PrintInputSelectedRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_INPUT_SELECTED_REQUEST { return Err(ParseError::InvalidValue); @@ -2055,7 +2055,7 @@ impl PrintGetAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -2207,7 +2207,7 @@ impl<'input> PrintGetOneAttributesRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PRINT_GET_ONE_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -2372,7 +2372,7 @@ impl<'input> PrintSetAttributesRequest<'input> { ([request0.into(), self.attributes, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PRINT_SET_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -2452,7 +2452,7 @@ impl PrintGetPageDimensionsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_PAGE_DIMENSIONS_REQUEST { return Err(ParseError::InvalidValue); @@ -2600,7 +2600,7 @@ impl PrintQueryScreensRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_QUERY_SCREENS_REQUEST { return Err(ParseError::InvalidValue); @@ -2736,7 +2736,7 @@ impl PrintSetImageResolutionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_SET_IMAGE_RESOLUTION_REQUEST { return Err(ParseError::InvalidValue); @@ -2865,7 +2865,7 @@ impl PrintGetImageResolutionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PRINT_GET_IMAGE_RESOLUTION_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xproto.rs b/x11rb-protocol/src/protocol/xproto.rs index 8ad4b1ae..cd9bf7b5 100644 --- a/x11rb-protocol/src/protocol/xproto.rs +++ b/x11rb-protocol/src/protocol/xproto.rs @@ -7076,6 +7076,7 @@ impl core::fmt::Debug for CreateWindowAux { } } impl CreateWindowAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -7551,7 +7552,7 @@ impl<'input> CreateWindowRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CREATE_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -7644,6 +7645,7 @@ impl core::fmt::Debug for ChangeWindowAttributesAux { } } impl ChangeWindowAttributesAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -8047,7 +8049,7 @@ impl<'input> ChangeWindowAttributesRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_WINDOW_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -8194,7 +8196,7 @@ impl GetWindowAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_WINDOW_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -8458,7 +8460,7 @@ impl DestroyWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != DESTROY_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -8522,7 +8524,7 @@ impl DestroySubwindowsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != DESTROY_SUBWINDOWS_REQUEST { return Err(ParseError::InvalidValue); @@ -8669,7 +8671,7 @@ impl ChangeSaveSetRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CHANGE_SAVE_SET_REQUEST { return Err(ParseError::InvalidValue); @@ -8781,7 +8783,7 @@ impl ReparentWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != REPARENT_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -8886,7 +8888,7 @@ impl MapWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != MAP_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -8950,7 +8952,7 @@ impl MapSubwindowsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != MAP_SUBWINDOWS_REQUEST { return Err(ParseError::InvalidValue); @@ -9035,7 +9037,7 @@ impl UnmapWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNMAP_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -9099,7 +9101,7 @@ impl UnmapSubwindowsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNMAP_SUBWINDOWS_REQUEST { return Err(ParseError::InvalidValue); @@ -9264,6 +9266,7 @@ impl core::fmt::Debug for ConfigureWindowAux { } } impl ConfigureWindowAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u16) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u16::from(value_mask); let mut outer_remaining = value; @@ -9565,7 +9568,7 @@ impl<'input> ConfigureWindowRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CONFIGURE_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -9718,7 +9721,7 @@ impl CirculateWindowRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CIRCULATE_WINDOW_REQUEST { return Err(ParseError::InvalidValue); @@ -9820,7 +9823,7 @@ impl GetGeometryRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_GEOMETRY_REQUEST { return Err(ParseError::InvalidValue); @@ -10036,7 +10039,7 @@ impl QueryTreeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != QUERY_TREE_REQUEST { return Err(ParseError::InvalidValue); @@ -10231,7 +10234,7 @@ impl<'input> InternAtomRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != INTERN_ATOM_REQUEST { return Err(ParseError::InvalidValue); @@ -10371,7 +10374,7 @@ impl GetAtomNameRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_ATOM_NAME_REQUEST { return Err(ParseError::InvalidValue); @@ -10659,7 +10662,7 @@ impl<'input> ChangePropertyRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -10754,7 +10757,7 @@ impl DeletePropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != DELETE_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -10971,7 +10974,7 @@ impl GetPropertyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_PROPERTY_REQUEST { return Err(ParseError::InvalidValue); @@ -11276,7 +11279,7 @@ impl ListPropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != LIST_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -11452,7 +11455,7 @@ impl SetSelectionOwnerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != SET_SELECTION_OWNER_REQUEST { return Err(ParseError::InvalidValue); @@ -11537,7 +11540,7 @@ impl GetSelectionOwnerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_SELECTION_OWNER_REQUEST { return Err(ParseError::InvalidValue); @@ -11694,7 +11697,7 @@ impl ConvertSelectionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CONVERT_SELECTION_REQUEST { return Err(ParseError::InvalidValue); @@ -11920,7 +11923,7 @@ impl<'input> SendEventRequest<'input> { ([request0.into(), Cow::Owned(self.event.to_vec())], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SEND_EVENT_REQUEST { return Err(ParseError::InvalidValue); @@ -12287,7 +12290,7 @@ impl GrabPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GRAB_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -12451,7 +12454,7 @@ impl UngrabPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNGRAB_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -12689,7 +12692,7 @@ impl GrabButtonRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GRAB_BUTTON_REQUEST { return Err(ParseError::InvalidValue); @@ -12782,7 +12785,7 @@ impl UngrabButtonRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNGRAB_BUTTON_REQUEST { return Err(ParseError::InvalidValue); @@ -12864,7 +12867,7 @@ impl ChangeActivePointerGrabRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CHANGE_ACTIVE_POINTER_GRAB_REQUEST { return Err(ParseError::InvalidValue); @@ -13012,7 +13015,7 @@ impl GrabKeyboardRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GRAB_KEYBOARD_REQUEST { return Err(ParseError::InvalidValue); @@ -13147,7 +13150,7 @@ impl UngrabKeyboardRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNGRAB_KEYBOARD_REQUEST { return Err(ParseError::InvalidValue); @@ -13345,7 +13348,7 @@ impl GrabKeyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GRAB_KEY_REQUEST { return Err(ParseError::InvalidValue); @@ -13455,7 +13458,7 @@ impl UngrabKeyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNGRAB_KEY_REQUEST { return Err(ParseError::InvalidValue); @@ -13674,7 +13677,7 @@ impl AllowEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != ALLOW_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -13733,7 +13736,7 @@ impl GrabServerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GRAB_SERVER_REQUEST { return Err(ParseError::InvalidValue); @@ -13788,7 +13791,7 @@ impl UngrabServerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNGRAB_SERVER_REQUEST { return Err(ParseError::InvalidValue); @@ -13863,7 +13866,7 @@ impl QueryPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != QUERY_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -14117,7 +14120,7 @@ impl GetMotionEventsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_MOTION_EVENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -14270,7 +14273,7 @@ impl TranslateCoordinatesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != TRANSLATE_COORDINATES_REQUEST { return Err(ParseError::InvalidValue); @@ -14482,7 +14485,7 @@ impl WarpPointerRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != WARP_POINTER_REQUEST { return Err(ParseError::InvalidValue); @@ -14675,7 +14678,7 @@ impl SetInputFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != SET_INPUT_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -14736,7 +14739,7 @@ impl GetInputFocusRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_INPUT_FOCUS_REQUEST { return Err(ParseError::InvalidValue); @@ -14860,7 +14863,7 @@ impl QueryKeymapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != QUERY_KEYMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -15044,7 +15047,7 @@ impl<'input> OpenFontRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != OPEN_FONT_REQUEST { return Err(ParseError::InvalidValue); @@ -15119,7 +15122,7 @@ impl CloseFontRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CLOSE_FONT_REQUEST { return Err(ParseError::InvalidValue); @@ -15357,7 +15360,7 @@ impl QueryFontRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != QUERY_FONT_REQUEST { return Err(ParseError::InvalidValue); @@ -15600,7 +15603,7 @@ impl<'input> QueryTextExtentsRequest<'input> { ([request0.into(), string_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != QUERY_TEXT_EXTENTS_REQUEST { return Err(ParseError::InvalidValue); @@ -15863,7 +15866,7 @@ impl<'input> ListFontsRequest<'input> { ([request0.into(), self.pattern, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != LIST_FONTS_REQUEST { return Err(ParseError::InvalidValue); @@ -16028,7 +16031,7 @@ impl<'input> ListFontsWithInfoRequest<'input> { ([request0.into(), self.pattern, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != LIST_FONTS_WITH_INFO_REQUEST { return Err(ParseError::InvalidValue); @@ -16249,7 +16252,7 @@ impl<'input> SetFontPathRequest<'input> { ([request0.into(), font_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SET_FONT_PATH_REQUEST { return Err(ParseError::InvalidValue); @@ -16314,7 +16317,7 @@ impl GetFontPathRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_FONT_PATH_REQUEST { return Err(ParseError::InvalidValue); @@ -16486,7 +16489,7 @@ impl CreatePixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CREATE_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -16569,7 +16572,7 @@ impl FreePixmapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != FREE_PIXMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -17241,6 +17244,7 @@ impl core::fmt::Debug for CreateGCAux { } } impl CreateGCAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -17816,7 +17820,7 @@ impl<'input> CreateGCRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CREATE_GC_REQUEST { return Err(ParseError::InvalidValue); @@ -17893,6 +17897,7 @@ impl core::fmt::Debug for ChangeGCAux { } } impl ChangeGCAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -18483,7 +18488,7 @@ impl<'input> ChangeGCRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_GC_REQUEST { return Err(ParseError::InvalidValue); @@ -18569,7 +18574,7 @@ impl CopyGCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != COPY_GC_REQUEST { return Err(ParseError::InvalidValue); @@ -18650,7 +18655,7 @@ impl<'input> SetDashesRequest<'input> { ([request0.into(), self.dashes, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SET_DASHES_REQUEST { return Err(ParseError::InvalidValue); @@ -18805,7 +18810,7 @@ impl<'input> SetClipRectanglesRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SET_CLIP_RECTANGLES_REQUEST { return Err(ParseError::InvalidValue); @@ -18905,7 +18910,7 @@ impl FreeGCRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != FREE_GC_REQUEST { return Err(ParseError::InvalidValue); @@ -18987,7 +18992,7 @@ impl ClearAreaRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CLEAR_AREA_REQUEST { return Err(ParseError::InvalidValue); @@ -19117,7 +19122,7 @@ impl CopyAreaRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != COPY_AREA_REQUEST { return Err(ParseError::InvalidValue); @@ -19239,7 +19244,7 @@ impl CopyPlaneRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != COPY_PLANE_REQUEST { return Err(ParseError::InvalidValue); @@ -19397,7 +19402,7 @@ impl<'input> PolyPointRequest<'input> { ([request0.into(), points_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_POINT_REQUEST { return Err(ParseError::InvalidValue); @@ -19535,7 +19540,7 @@ impl<'input> PolyLineRequest<'input> { ([request0.into(), points_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_LINE_REQUEST { return Err(ParseError::InvalidValue); @@ -19710,7 +19715,7 @@ impl<'input> PolySegmentRequest<'input> { ([request0.into(), segments_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_SEGMENT_REQUEST { return Err(ParseError::InvalidValue); @@ -19804,7 +19809,7 @@ impl<'input> PolyRectangleRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_RECTANGLE_REQUEST { return Err(ParseError::InvalidValue); @@ -19898,7 +19903,7 @@ impl<'input> PolyArcRequest<'input> { ([request0.into(), arcs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_ARC_REQUEST { return Err(ParseError::InvalidValue); @@ -20061,7 +20066,7 @@ impl<'input> FillPolyRequest<'input> { ([request0.into(), points_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != FILL_POLY_REQUEST { return Err(ParseError::InvalidValue); @@ -20189,7 +20194,7 @@ impl<'input> PolyFillRectangleRequest<'input> { ([request0.into(), rectangles_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_FILL_RECTANGLE_REQUEST { return Err(ParseError::InvalidValue); @@ -20283,7 +20288,7 @@ impl<'input> PolyFillArcRequest<'input> { ([request0.into(), arcs_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_FILL_ARC_REQUEST { return Err(ParseError::InvalidValue); @@ -20463,7 +20468,7 @@ impl<'input> PutImageRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != PUT_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -20585,7 +20590,7 @@ impl GetImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -20754,7 +20759,7 @@ impl<'input> PolyText8Request<'input> { ([request0.into(), self.items, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_TEXT8_REQUEST { return Err(ParseError::InvalidValue); @@ -20854,7 +20859,7 @@ impl<'input> PolyText16Request<'input> { ([request0.into(), self.items, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != POLY_TEXT16_REQUEST { return Err(ParseError::InvalidValue); @@ -20988,7 +20993,7 @@ impl<'input> ImageText8Request<'input> { ([request0.into(), self.string, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != IMAGE_TEXT8_REQUEST { return Err(ParseError::InvalidValue); @@ -21124,7 +21129,7 @@ impl<'input> ImageText16Request<'input> { ([request0.into(), string_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != IMAGE_TEXT16_REQUEST { return Err(ParseError::InvalidValue); @@ -21279,7 +21284,7 @@ impl CreateColormapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CREATE_COLORMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -21349,7 +21354,7 @@ impl FreeColormapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != FREE_COLORMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -21419,7 +21424,7 @@ impl CopyColormapAndFreeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != COPY_COLORMAP_AND_FREE_REQUEST { return Err(ParseError::InvalidValue); @@ -21485,7 +21490,7 @@ impl InstallColormapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != INSTALL_COLORMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -21549,7 +21554,7 @@ impl UninstallColormapRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != UNINSTALL_COLORMAP_REQUEST { return Err(ParseError::InvalidValue); @@ -21613,7 +21618,7 @@ impl ListInstalledColormapsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != LIST_INSTALLED_COLORMAPS_REQUEST { return Err(ParseError::InvalidValue); @@ -21780,7 +21785,7 @@ impl AllocColorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != ALLOC_COLOR_REQUEST { return Err(ParseError::InvalidValue); @@ -21949,7 +21954,7 @@ impl<'input> AllocNamedColorRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != ALLOC_NAMED_COLOR_REQUEST { return Err(ParseError::InvalidValue); @@ -22136,7 +22141,7 @@ impl AllocColorCellsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != ALLOC_COLOR_CELLS_REQUEST { return Err(ParseError::InvalidValue); @@ -22313,7 +22318,7 @@ impl AllocColorPlanesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != ALLOC_COLOR_PLANES_REQUEST { return Err(ParseError::InvalidValue); @@ -22479,7 +22484,7 @@ impl<'input> FreeColorsRequest<'input> { ([request0.into(), pixels_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != FREE_COLORS_REQUEST { return Err(ParseError::InvalidValue); @@ -22692,7 +22697,7 @@ impl<'input> StoreColorsRequest<'input> { ([request0.into(), items_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != STORE_COLORS_REQUEST { return Err(ParseError::InvalidValue); @@ -22790,7 +22795,7 @@ impl<'input> StoreNamedColorRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != STORE_NAMED_COLOR_REQUEST { return Err(ParseError::InvalidValue); @@ -22926,7 +22931,7 @@ impl<'input> QueryColorsRequest<'input> { ([request0.into(), pixels_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != QUERY_COLORS_REQUEST { return Err(ParseError::InvalidValue); @@ -23087,7 +23092,7 @@ impl<'input> LookupColorRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != LOOKUP_COLOR_REQUEST { return Err(ParseError::InvalidValue); @@ -23357,7 +23362,7 @@ impl CreateCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CREATE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -23575,7 +23580,7 @@ impl CreateGlyphCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CREATE_GLYPH_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -23671,7 +23676,7 @@ impl FreeCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != FREE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -23759,7 +23764,7 @@ impl RecolorCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != RECOLOR_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -23906,7 +23911,7 @@ impl QueryBestSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != QUERY_BEST_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -24071,7 +24076,7 @@ impl<'input> QueryExtensionRequest<'input> { ([request0.into(), self.name, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != QUERY_EXTENSION_REQUEST { return Err(ParseError::InvalidValue); @@ -24220,7 +24225,7 @@ impl ListExtensionsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != LIST_EXTENSIONS_REQUEST { return Err(ParseError::InvalidValue); @@ -24361,7 +24366,7 @@ impl<'input> ChangeKeyboardMappingRequest<'input> { ([request0.into(), keysyms_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_KEYBOARD_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -24442,7 +24447,7 @@ impl GetKeyboardMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_KEYBOARD_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -24718,6 +24723,7 @@ impl core::fmt::Debug for ChangeKeyboardControlAux { } } impl ChangeKeyboardControlAux { + #[cfg_attr(not(feature = "request-parsing"), allow(dead_code))] fn try_parse(value: &[u8], value_mask: u32) -> Result<(Self, &[u8]), ParseError> { let switch_expr = u32::from(value_mask); let mut outer_remaining = value; @@ -24952,7 +24958,7 @@ impl<'input> ChangeKeyboardControlRequest<'input> { ([request0.into(), value_list_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_KEYBOARD_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -25016,7 +25022,7 @@ impl GetKeyboardControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_KEYBOARD_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -25204,7 +25210,7 @@ impl BellRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != BELL_REQUEST { return Err(ParseError::InvalidValue); @@ -25279,7 +25285,7 @@ impl ChangePointerControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != CHANGE_POINTER_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -25344,7 +25350,7 @@ impl GetPointerControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_POINTER_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -25634,7 +25640,7 @@ impl SetScreenSaverRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != SET_SCREEN_SAVER_REQUEST { return Err(ParseError::InvalidValue); @@ -25699,7 +25705,7 @@ impl GetScreenSaverRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_SCREEN_SAVER_REQUEST { return Err(ParseError::InvalidValue); @@ -25995,7 +26001,7 @@ impl<'input> ChangeHostsRequest<'input> { ([request0.into(), self.address, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != CHANGE_HOSTS_REQUEST { return Err(ParseError::InvalidValue); @@ -26130,7 +26136,7 @@ impl ListHostsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != LIST_HOSTS_REQUEST { return Err(ParseError::InvalidValue); @@ -26320,7 +26326,7 @@ impl SetAccessControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != SET_ACCESS_CONTROL_REQUEST { return Err(ParseError::InvalidValue); @@ -26441,7 +26447,7 @@ impl SetCloseDownModeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != SET_CLOSE_DOWN_MODE_REQUEST { return Err(ParseError::InvalidValue); @@ -26581,7 +26587,7 @@ impl KillClientRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != KILL_CLIENT_REQUEST { return Err(ParseError::InvalidValue); @@ -26658,7 +26664,7 @@ impl<'input> RotatePropertiesRequest<'input> { ([request0.into(), atoms_bytes.into(), padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != ROTATE_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -26790,7 +26796,7 @@ impl ForceScreenSaverRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != FORCE_SCREEN_SAVER_REQUEST { return Err(ParseError::InvalidValue); @@ -26915,7 +26921,7 @@ impl<'input> SetPointerMappingRequest<'input> { ([request0.into(), self.map, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SET_POINTER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -27039,7 +27045,7 @@ impl GetPointerMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_POINTER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -27243,7 +27249,7 @@ impl<'input> SetModifierMappingRequest<'input> { ([request0.into(), self.keycodes, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.major_opcode != SET_MODIFIER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -27367,7 +27373,7 @@ impl GetModifierMappingRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != GET_MODIFIER_MAPPING_REQUEST { return Err(ParseError::InvalidValue); @@ -27494,7 +27500,7 @@ impl NoOperationRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.major_opcode != NO_OPERATION_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xselinux.rs b/x11rb-protocol/src/protocol/xselinux.rs index 734d0f92..dc030049 100644 --- a/x11rb-protocol/src/protocol/xselinux.rs +++ b/x11rb-protocol/src/protocol/xselinux.rs @@ -74,7 +74,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -211,7 +211,7 @@ impl<'input> SetDeviceCreateContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -272,7 +272,7 @@ impl GetDeviceCreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -413,7 +413,7 @@ impl<'input> SetDeviceContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_DEVICE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -484,7 +484,7 @@ impl GetDeviceContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_DEVICE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -621,7 +621,7 @@ impl<'input> SetWindowCreateContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_WINDOW_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -682,7 +682,7 @@ impl GetWindowCreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_WINDOW_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -813,7 +813,7 @@ impl GetWindowContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_WINDOW_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1035,7 +1035,7 @@ impl<'input> SetPropertyCreateContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_PROPERTY_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1096,7 +1096,7 @@ impl GetPropertyCreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROPERTY_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1231,7 +1231,7 @@ impl<'input> SetPropertyUseContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_PROPERTY_USE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1292,7 +1292,7 @@ impl GetPropertyUseContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROPERTY_USE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1429,7 +1429,7 @@ impl GetPropertyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROPERTY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1570,7 +1570,7 @@ impl GetPropertyDataContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PROPERTY_DATA_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1705,7 +1705,7 @@ impl ListPropertiesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_PROPERTIES_REQUEST { return Err(ParseError::InvalidValue); @@ -1841,7 +1841,7 @@ impl<'input> SetSelectionCreateContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_SELECTION_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -1902,7 +1902,7 @@ impl GetSelectionCreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SELECTION_CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -2037,7 +2037,7 @@ impl<'input> SetSelectionUseContextRequest<'input> { ([request0.into(), self.context, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != SET_SELECTION_USE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -2098,7 +2098,7 @@ impl GetSelectionUseContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SELECTION_USE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -2229,7 +2229,7 @@ impl GetSelectionContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SELECTION_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -2362,7 +2362,7 @@ impl GetSelectionDataContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_SELECTION_DATA_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -2488,7 +2488,7 @@ impl ListSelectionsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_SELECTIONS_REQUEST { return Err(ParseError::InvalidValue); @@ -2618,7 +2618,7 @@ impl GetClientContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_CLIENT_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xtest.rs b/x11rb-protocol/src/protocol/xtest.rs index 4a662dc4..3cef4203 100644 --- a/x11rb-protocol/src/protocol/xtest.rs +++ b/x11rb-protocol/src/protocol/xtest.rs @@ -74,7 +74,7 @@ impl GetVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -281,7 +281,7 @@ impl CompareCursorRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != COMPARE_CURSOR_REQUEST { return Err(ParseError::InvalidValue); @@ -444,7 +444,7 @@ impl FakeInputRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != FAKE_INPUT_REQUEST { return Err(ParseError::InvalidValue); @@ -520,7 +520,7 @@ impl GrabControlRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GRAB_CONTROL_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xv.rs b/x11rb-protocol/src/protocol/xv.rs index 189faf82..603b1366 100644 --- a/x11rb-protocol/src/protocol/xv.rs +++ b/x11rb-protocol/src/protocol/xv.rs @@ -1413,7 +1413,7 @@ impl QueryExtensionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_EXTENSION_REQUEST { return Err(ParseError::InvalidValue); @@ -1542,7 +1542,7 @@ impl QueryAdaptorsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_ADAPTORS_REQUEST { return Err(ParseError::InvalidValue); @@ -1674,7 +1674,7 @@ impl QueryEncodingsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_ENCODINGS_REQUEST { return Err(ParseError::InvalidValue); @@ -1812,7 +1812,7 @@ impl GrabPortRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GRAB_PORT_REQUEST { return Err(ParseError::InvalidValue); @@ -1942,7 +1942,7 @@ impl UngrabPortRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != UNGRAB_PORT_REQUEST { return Err(ParseError::InvalidValue); @@ -2049,7 +2049,7 @@ impl PutVideoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PUT_VIDEO_REQUEST { return Err(ParseError::InvalidValue); @@ -2174,7 +2174,7 @@ impl PutStillRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != PUT_STILL_REQUEST { return Err(ParseError::InvalidValue); @@ -2299,7 +2299,7 @@ impl GetVideoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_VIDEO_REQUEST { return Err(ParseError::InvalidValue); @@ -2424,7 +2424,7 @@ impl GetStillRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_STILL_REQUEST { return Err(ParseError::InvalidValue); @@ -2511,7 +2511,7 @@ impl StopVideoRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != STOP_VIDEO_REQUEST { return Err(ParseError::InvalidValue); @@ -2580,7 +2580,7 @@ impl SelectVideoNotifyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_VIDEO_NOTIFY_REQUEST { return Err(ParseError::InvalidValue); @@ -2650,7 +2650,7 @@ impl SelectPortNotifyRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SELECT_PORT_NOTIFY_REQUEST { return Err(ParseError::InvalidValue); @@ -2736,7 +2736,7 @@ impl QueryBestSizeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_BEST_SIZE_REQUEST { return Err(ParseError::InvalidValue); @@ -2890,7 +2890,7 @@ impl SetPortAttributeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SET_PORT_ATTRIBUTE_REQUEST { return Err(ParseError::InvalidValue); @@ -2961,7 +2961,7 @@ impl GetPortAttributeRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != GET_PORT_ATTRIBUTE_REQUEST { return Err(ParseError::InvalidValue); @@ -3090,7 +3090,7 @@ impl QueryPortAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_PORT_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -3225,7 +3225,7 @@ impl ListImageFormatsRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_IMAGE_FORMATS_REQUEST { return Err(ParseError::InvalidValue); @@ -3371,7 +3371,7 @@ impl QueryImageAttributesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_IMAGE_ATTRIBUTES_REQUEST { return Err(ParseError::InvalidValue); @@ -3584,7 +3584,7 @@ impl<'input> PutImageRequest<'input> { ([request0.into(), self.data, padding0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &'input [u8]) -> Result { if header.minor_opcode != PUT_IMAGE_REQUEST { return Err(ParseError::InvalidValue); @@ -3769,7 +3769,7 @@ impl ShmPutImageRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != SHM_PUT_IMAGE_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb-protocol/src/protocol/xvmc.rs b/x11rb-protocol/src/protocol/xvmc.rs index b67b6ebf..8504ab4b 100644 --- a/x11rb-protocol/src/protocol/xvmc.rs +++ b/x11rb-protocol/src/protocol/xvmc.rs @@ -159,7 +159,7 @@ impl QueryVersionRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != QUERY_VERSION_REQUEST { return Err(ParseError::InvalidValue); @@ -292,7 +292,7 @@ impl ListSurfaceTypesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_SURFACE_TYPES_REQUEST { return Err(ParseError::InvalidValue); @@ -450,7 +450,7 @@ impl CreateContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -598,7 +598,7 @@ impl DestroyContextRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_CONTEXT_REQUEST { return Err(ParseError::InvalidValue); @@ -665,7 +665,7 @@ impl CreateSurfaceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_SURFACE_REQUEST { return Err(ParseError::InvalidValue); @@ -796,7 +796,7 @@ impl DestroySurfaceRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_SURFACE_REQUEST { return Err(ParseError::InvalidValue); @@ -877,7 +877,7 @@ impl CreateSubpictureRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != CREATE_SUBPICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -1029,7 +1029,7 @@ impl DestroySubpictureRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != DESTROY_SUBPICTURE_REQUEST { return Err(ParseError::InvalidValue); @@ -1096,7 +1096,7 @@ impl ListSubpictureTypesRequest { ([request0.into()], vec![]) } /// Parse this request given its header, its body, and any fds that go along with it - #[cfg(feature = "extra-traits")] + #[cfg(feature = "request-parsing")] pub fn try_parse_request(header: RequestHeader, value: &[u8]) -> Result { if header.minor_opcode != LIST_SUBPICTURE_TYPES_REQUEST { return Err(ParseError::InvalidValue); diff --git a/x11rb/src/lib.rs b/x11rb/src/lib.rs index 2faf2df4..2692c7a8 100644 --- a/x11rb/src/lib.rs +++ b/x11rb/src/lib.rs @@ -108,6 +108,9 @@ //! resulting executable. Instead libxcb will be dynamically loaded at runtime. //! This feature adds the [`crate::xcb_ffi::load_libxcb`] function, that allows to load //! libxcb and check for success or failure. +//! * `extra-traits`: Enable some additional traits for generated code, like `Eq`, `Ord` and +//! `Hash`. This is not needed by default and adds a large amount of code that bloats codegen +//! time //! //! # Integrating x11rb with an Event Loop //! diff --git a/xtrace-example/Cargo.toml b/xtrace-example/Cargo.toml index 37ea9586..02638bc4 100644 --- a/xtrace-example/Cargo.toml +++ b/xtrace-example/Cargo.toml @@ -11,7 +11,7 @@ smol = "1.3" [dependencies.x11rb-protocol] path = "../x11rb-protocol" -features = ["all-extensions"] +features = ["all-extensions", "request-parsing"] [dependencies.futures-util] version = "0.3"