Trait easyjack::Port [] [src]

pub trait Port {
    fn get_name(&self) -> String { ... }
    fn get_port_flags(&self) -> PortFlags { ... }
}

Ports are the means by which jack clients communicate with each other.

The port wrappers in easyjack have slightly confusing type definitions due to the behavior of the underlying JACK C API. The interface they expose is also much more "C" like than rust like.

Each of the Port structs defined implement the Port trait, which should be sufficient for use in many situations, however, occasionally, we may want to access pieces of data which are only available on specific types of ports.

Because the JACK C api handles all ports with a jack_port_t structure, we are limited in our ability to determine the exact properties of a port at compile time. For example, if you ask the JACK API to give you a port, by name, you cannot know all of the various properties of the port without additional inspection. This additional inspection will incur additional costs, so we have chosen to make all additional inspection optional.

This means that many of the easyjack API methods will return an UnknownPortHandle, and users of the API methods will have the option to attempt to promote this UnknownPortHandle to ports of different types. These attempts at conversion will perform additional inspection of the port's flags (unless the unsafe versions are used)

One additional note about Port types. All of these port types are only handles to underlying ports (think of them as an index into a vector). All of these port types implement Copy. This means that a Port "handle" may become invalid if the port becomes invalid. Using a port after it has become invalid is undefined behavior and may cause all sorts of strange things to occur.

Provided Methods

Gets the port's assigned full name (including the client name and the colon)

Get the flags used to construct this port

Implementors