func MessageToMessageType(d Message) (MessageType, error) {
	switch d.(type) {
	case *VersionRequest:
		return Tversion, nil
	case *VersionResponse:
		return Rversion, nil
	case *AuthRequest:
		return Tauth, nil
	case *AuthResponse:
		return Rauth, nil
	case *AttachRequest:
		return Tattach, nil
	case *AttachResponse:
		return Rattach, nil
	case *ErrorResponse:
		return Rerror, nil
	case *FlushRequest:
		return Tflush, nil
	case *FlushResponse:
		return Rflush, nil
	case *WalkRequest:
		return Twalk, nil
	case *WalkResponse:
		return Rwalk, nil
	case *OpenRequest:
		return Topen, nil
	case *OpenResponse:
		return Ropen, nil
	case *CreateRequest:
		return Tcreate, nil
	case *CreateResponse:
		return Rcreate, nil
	case *ReadRequest:
		return Tread, nil
	case *ReadResponse:
		return Rread, nil
	case *WriteRequest:
		return Twrite, nil
	case *WriteResponse:
		return Rwrite, nil
	case *ClunkRequest:
		return Tclunk, nil
	case *ClunkResponse:
		return Rclunk, nil
	case *RemoveRequest:
		return Tremove, nil
	case *RemoveResponse:
		return Rremove, nil
	case *StatRequest:
		return Tstat, nil
	case *StatResponse:
		return Rstat, nil
	case *WriteStatRequest:
		return Twstat, nil
	case *WriteStatResponse:
		return Rwstat, nil
	default:
		return Tlast, ErrUnknownMessageType
	}
}
// MessageToMessageType returns the message type of a given message.
MessageToMessageType returns the message type of a given message.
// MessageToMessageType returns the message type of a given message .
func MessageToMessageType(d Message) (MessageType, error) {
	switch d.(type) {
	case *VersionRequest:
		return Tversion, nil
	case *VersionResponse:
		return Rversion, nil
	case *AuthRequest:
		return Tauth, nil
	case *AuthResponse:
		return Rauth, nil
	case *AttachRequest:
		return Tattach, nil
	case *AttachResponse:
		return Rattach, nil
	case *ErrorResponse:
		return Rerror, nil
	case *FlushRequest:
		return Tflush, nil
	case *FlushResponse:
		return Rflush, nil
	case *WalkRequest:
		return Twalk, nil
	case *WalkResponse:
		return Rwalk, nil
	case *OpenRequest:
		return Topen, nil
	case *OpenResponse:
		return Ropen, nil
	case *CreateRequest:
		return Tcreate, nil
	case *CreateResponse:
		return Rcreate, nil
	case *ReadRequest:
		return Tread, nil
	case *ReadResponse:
		return Rread, nil
	case *WriteRequest:
		return Twrite, nil
	case *WriteResponse:
		return Rwrite, nil
	case *ClunkRequest:
		return Tclunk, nil
	case *ClunkResponse:
		return Rclunk, nil
	case *RemoveRequest:
		return Tremove, nil
	case *RemoveResponse:
		return Rremove, nil
	case *StatRequest:
		return Tstat, nil
	case *StatResponse:
		return Rstat, nil
	case *WriteStatRequest:
		return Twstat, nil
	case *WriteStatResponse:
		return Rwstat, nil
	default:
		return Tlast, ErrUnknownMessageType
	}
}
func MessageToMessageType ( d Message ) ( MessageType , error ) { switch d . ( type ) { case * VersionRequest : return Tversion , nil case * VersionResponse : return Rversion , nil case * AuthRequest : return Tauth , nil case * AuthResponse : return Rauth , nil case * AttachRequest : return Tattach , nil case * AttachResponse : return Rattach , nil case * ErrorResponse : return Rerror , nil case * FlushRequest : return Tflush , nil case * FlushResponse : return Rflush , nil case * WalkRequest : return Twalk , nil case * WalkResponse : return Rwalk , nil case * OpenRequest : return Topen , nil case * OpenResponse : return Ropen , nil case * CreateRequest : return Tcreate , nil case * CreateResponse : return Rcreate , nil case * ReadRequest : return Tread , nil case * ReadResponse : return Rread , nil case * WriteRequest : return Twrite , nil case * WriteResponse : return Rwrite , nil case * ClunkRequest : return Tclunk , nil case * ClunkResponse : return Rclunk , nil case * RemoveRequest : return Tremove , nil case * RemoveResponse : return Rremove , nil case * StatRequest : return Tstat , nil case * StatResponse : return Rstat , nil case * WriteStatRequest : return Twstat , nil case * WriteStatResponse : return Rwstat , nil default : return Tlast , ErrUnknownMessageType } }
MessageToMessageType returns the message type of a given message.
MessageToMessageType returns the message type of a given message .