Skip to content

Proposal: Introduce a prelude module #356

@fpdotmonkey

Description

@fpdotmonkey

I'm often finding that I'm having very long, very repetitive ethercrab imports in my projects. I think people would agree that there is a set of types which is required to use Ethercrab, so re-exporting them from prelude would make sense and save on repetition.

The question is, which symbols should be exported? This is my proposal.

  • SubDevice
  • MainDevice
  • SubDeviceGroup
  • MainDeviceConfig
  • PduStorage
  • ethercrab::std::ethercat_now
  • (possibly) tx_rx_task
  • (possibly) Timeouts

and in a separate prelude for ethercrab_wire

  • EtherCrabWireWrite
  • EtherCrabWireRead
  • EtherCrabWireReadWrite
  • EtherCrabWireWriteSized
  • EtherCrabWireReadSized

One frequently-used type that shouldn't be in a prelude is ethercrab::error::Error given how common that name is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions